Sumproduct to count multiple criteria

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,047
Afternoon all, I am counting within a range (F5 to BZ5 ) if the cells contain one of 52 different codes. Rather then creating a very long code with COUNTIFS I am certain that I can do this using SUMPRODUCT and creating those 52 codes in a named range but I can't remember how to do it. Anyone able to help please ?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
can you provide 2 lines of ur spreadsheet as minisheet with result example?
if the cells contain one of 52 different codes
are you looking for just 1 code number that is unique within this list?
or
are you trying to get all codes but with no reapets?

there is filter and unique functions in Excel, so maybe that's what ur looking for?
 
Upvote 0
Hi perhaps, I haven't explained well.

I have a named range, this range has 52 unique codes in it. The named range is called CODEA

Within that named range, codes exist such as 'GTET' 'TQJW' 'LPIW' etc etc

On a sheet called planner I have a list of staff in column A


So on A5 I will have an employee called Jack Torro, in cells F5 to BZ5 there maybe some codes, if the code in H5 = GTET and in BD5 = LPIW, then

in CA5 I want the count to equal 2

Hope that makes sense

Thanks

Paul
 
Upvote 0
What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you please post some sample data & expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
See if this example helps

Pasta1
ABCDEFGHIJK
1NamesCODE1CODE2CODE3CODE4CODE5ResultCODEA
2CharleszzzGTETxxxLPIWabc2GTET
3MikeLPIWxxxzzzdef1TQJW
4MaryxxxGTETTQJWLPIW3LPIW
5Richardxxxvvvzzzyyybcd0
Plan4
Cell Formulas
RangeFormula
G2:G5G2=SUMPRODUCT(--ISNUMBER(MATCH(B2:F2,CODEA,0)))
Named Ranges
NameRefers ToCells
CODEA=Plan4!$K$2:$K$4G2:G5


M.
 
Upvote 0
See if this example helps

Pasta1
ABCDEFGHIJK
1NamesCODE1CODE2CODE3CODE4CODE5ResultCODEA
2CharleszzzGTETxxxLPIWabc2GTET
3MikeLPIWxxxzzzdef1TQJW
4MaryxxxGTETTQJWLPIW3LPIW
5Richardxxxvvvzzzyyybcd0
Plan4
Cell Formulas
RangeFormula
G2:G5G2=SUMPRODUCT(--ISNUMBER(MATCH(B2:F2,CODEA,0)))
Named Ranges
NameRefers ToCells
CODEA=Plan4!$K$2:$K$4G2:G5


M.
Thank you
 
Upvote 0

Forum statistics

Threads
1,215,866
Messages
6,127,403
Members
449,382
Latest member
DonnaRisso

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top