=COUNTIFS with two labels

DPChristman

Board Regular
Joined
Sep 4, 2012
Messages
176
Office Version
  1. 365
Platform
  1. Windows
I am trying to calculate the number of time a persons initials appear for a specific location.
The search range is COL I-ROW 5 through COL CD-ROW 204 in Sheet 1 of the spreadsheet, and the initials for the users appear on sheet 2 of the spreadsheet.
Using countif, I can find the number of times a specific user's initials appear in the range overall.
However, what I want to do is identify the number of times the initials appear for a Tier 1 and Tier 2 location.
I would think the formulas necessary would be =COUNTIFS(Sheet1!I5:CD204,A2,Sheet1!G:G,"Tier 1") and =COUNTIFS(Sheet1!I5:CD204,A2,Sheet1!G:G,"Tier 2"), but that is not working.
What am I missing?
1724478402046.png
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You will generally get faster and better responses if you use XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. If you have trouble with XL2BB review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of theXL2BB Instructions page linked above.

Here is a small example to see if it is doing what you want if so, you should be able to adapt it to your actual layout & ranges.

DPChristian.xlsm
GHIJK
5Tier 2BFCP
6Tier 2XY
7Tier 1CPAL
8Tier 1
9Tier 2BRCP
10Tier 1AL
Sheet1


DPChristian.xlsm
AB
1
2AL2
3BF0
4CP1
5
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=BYROW(A2:A4,LAMBDA(r,LET(I,TOCOL(IF(Sheet1!G5:G10="Tier 1",Sheet1!H5:J10,1/0),2),IFNA(ROWS(FILTER(I,I=r,NA())),0))))
Dynamic array formulas.
 
Upvote 0
Let's use headings on sheet2 to do the counting, for example:


Dante Amor
ABC
1InitTier 1Tier 2
2AL12
3BF11
4CP11
5DB30
Sheet2
Cell Formulas
RangeFormula
B2:C5B2=SUMPRODUCT((Sheet1!$I$5:$CD$204=$A2)*(Sheet1!$G$5:$G$204=B$1))


Dante Amor
AFGHIJKLMNO
1
2
3
4Target
5Tier 2AL
6Tier 2BF
7Tier 2CPAL
8Tier 1DBALBFDB
9Tier 1DBCP
10
Sheet1
 
Upvote 0
Let's use headings on sheet2 to do the counting, for example:


Dante Amor
ABC
1InitTier 1Tier 2
2AL12
3BF11
4CP11
5DB30
Sheet2
Cell Formulas
RangeFormula
B2:C5B2=SUMPRODUCT((Sheet1!$I$5:$CD$204=$A2)*(Sheet1!$G$5:$G$204=B$1))


Dante Amor
AFGHIJKLMNO
1
2
3
4Target
5Tier 2AL
6Tier 2BF
7Tier 2CPAL
8Tier 1DBALBFDB
9Tier 1DBCP
10
Sheet1

=SUMPRODUCT worked perfect! Thanks!
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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