Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2018, 10:22 AM
niklas24 niklas24 is offline Counting data from an external workbook Windows 7 64bit Counting data from an external workbook Office 2016
Novice
Counting data from an external workbook
 
Join Date: May 2018
Posts: 1
niklas24 is on a distinguished road
Exclamation Counting data from an external workbook

I have a column of data that I am trying to count based on specific criteria. I have attached an image of my data. I cannot use COUNTIFS because I need this to compute in a closed workbook. I must use SUMPRODUCT

Note - the values in row C4:F4 of the first attached image are what the results from the formula should yield. There is no formula applied to these cells.

The data in column A is actually in an external workbook and I am using the SUMPRODUCT function to try to count how many times any time 4* occurs in cell C2, however I need to keep any values that begin with 4B from being counted as part of 4* and count 4B* seperately in D2. Same thing with 00 (that's zero not O). Anything with 00B I do not want to count as part of 00*.

I have tried using the following generic formula:

in cells C2/E2
Code:
=SUMPRODUCT(--(LEFT([workbook.xlsx]Sheet!$A1:INDEX([workbook.xlsx]Sheet!$A:$A, MATCH("zzz", [workbook.xlsx]Sheet!$A:$A)), LEN(C1))=C1),
            --(LEFT([workbook.xlsx]Sheet!$A1:INDEX([workbook.xlsx]Sheet!$A:$A, MATCH("zzz", [workbook.xlsx]Sheet!$A:$A)), LEN(D1))<>D1))
in cell D2/F2
Code:
=SUMPRODUCT(--(LEFT([workbook.xlsx]Sheet!$A1:INDEX([workbook.xlsx]Sheet!$A:$A, MATCH("zzz", [workbook.xlsx]Sheet!$A:$A)), LEN(D1))=D1))

The formula works for D2:F2 just fine, but not in C2. I keep getting a value of zero and I have no idea why. I have tried manually retying the data in column A into a brand new sheet and assigning the cell category as both general and text but I still have the same problem. The second and third images show the formulas and values in cells C2 and E2. Does anyone have any idea why this is occurring?
Attached Images
File Type: png Capture2.PNG (33.6 KB, 22 views)
File Type: png count_problem_C2.png (293.1 KB, 21 views)
File Type: png count_problem_E2.png (292.0 KB, 20 views)
Reply With Quote
  #2  
Old 05-14-2018, 04:38 AM
p45cal's Avatar
p45cal p45cal is online now Counting data from an external workbook Windows 10 Counting data from an external workbook Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 870
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Please supply files which you've shown pictures of; it's hard work trying to recreate your scenario. If there's sensitive stuff in the files, remove all unnecessary sheets/code, but leave in your attempted formulae.
Reply With Quote
  #3  
Old 05-23-2018, 08:35 AM
Roger Govier Roger Govier is offline Counting data from an external workbook Windows 10 Counting data from an external workbook Office 2016
Novice
 
Join Date: Oct 2017
Location: Abergavenny, Wales, UK
Posts: 13
Roger Govier is on a distinguished road
Default

Hi

I think you need to also coerce your Lefts from Text values to Numbers and, your second part I think the test should be = and not <>

Code:
=SUMPRODUCT(--(--LEFT([workbook.xlsx]Sheet!$A1:INDEX([workbook.xlsx]Sheet!$A:$A, MATCH("zzz", [workbook.xlsx]Sheet!$A:$A)), LEN(C1))=C1),
            --(--LEFT([workbook.xlsx]Sheet!$A1:INDEX([workbook.xlsx]Sheet!$A:$A, MATCH("zzz", [workbook.xlsx]Sheet!$A:$A)), LEN(D1))D1))
Reply With Quote
Reply

Tags
excel formula, sumproduct



Similar Threads
Thread Thread Starter Forum Replies Last Post
data entered in one workbook should be updated in other relevant workbook based on the date vedha Excel 0 04-24-2015 08:45 PM
Counting data from an external workbook Counting multiple data in cell more than once Alaska1 Excel 3 03-01-2015 04:27 PM
Counting unique visitors by ward, counting monthly visits by status, editing existing workbook JaxV Excel 9 11-14-2014 12:25 AM
Counting data from an external workbook various data needs counting apples Excel 2 09-16-2012 04:52 AM
Counting data from an external workbook macro to transfer data from one workbook to another workbook virsojour Excel Programming 5 02-01-2011 08:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft