Count Value based on Matching Criteria

aspence

Board Regular
Joined
Feb 10, 2009
Messages
130
I am trying to count up the number of times A or B appear based on the corresponding unit type from Column I. I am having trouble making the value from column I search for a match of that value in column B. If they match, I need to add up the number of times A appears (in column J) or B appears (in column K).


Scheme.xlsx
ABCDEFGHIJK
1Unit Type1st FloorSecond FloorThird FloorFourth FloorFifth FloorUnit Type ListScheme A CountScheme B Count
21 StackB1LEASINGBABAA1
32 StackB3CLUBBABAA2
43 StackB1LEASINGABABA3
54 StackB2GAMEABABA4
65 StackB4FITNESSFITNESSABDECKA5
76 StackA6YOGAABABA6
87 StackA4ABABAA7
98 StackA6MICROBABAA8
109 StackA4BABABB1
1110 StackA2ABABAB2
1211 StackA7BABABB3
1312 StackA2BABABB4
1413 StackB6ABABAB5
1514 StackA3ABABAB6
1615 StackB5BABABS1
1716 StackA3BABAB172173
1817 StackA4ABABA
1918 StackB3POOLBABA
2019 StackS1BABAB
2120 StackS1ABABA
2221 StackA3BABAB
2322 StackS1BABAB
2423 StackS1ABABA
Sheet2
Cell Formulas
RangeFormula
J17J17=COUNTIF(C2:G75,"A")
K17K17=COUNTIF(C2:G75,"B")


I am apparently not using the COUNT function correctly, or am missing something entirely.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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’)
 
Upvote 0
One option that will work with most versions
Fluff.xlsm
ABCDEFGHIJK
1Unit Type1st FloorSecond FloorThird FloorFourth FloorFifth FloorUnit Type ListScheme A CountScheme B Count
21 StackB1LEASINGBABAA100
32 StackB3CLUBBABAA255
43 StackB1LEASINGABABA378
54 StackB2GAMEABABA487
65 StackB4FITNESSFITNESSABDECKA500
76 StackA6YOGAABABA644
87 StackA4ABABAA723
98 StackA6MICROBABAA800
109 StackA4BABABB144
1110 StackA2ABABAB222
1211 StackA7BABABB344
1312 StackA2BABABB411
1413 StackB6ABABAB523
1514 StackA3ABABAB632
1615 StackB5BABABS11010
1716 StackA3BABAB5253
1817 StackA4ABABA
1918 StackB3POOLBABA
2019 StackS1BABAB
2120 StackS1ABABA
2221 StackA3BABAB
2322 StackS1BABAB
2423 StackS1ABABA
Master
Cell Formulas
RangeFormula
J2:J16J2=SUMPRODUCT(($B$2:$B$24=I2)*($C$2:$G$24="A"))
K2:K16K2=SUMPRODUCT(($B$2:$B$24=I2)*($C$2:$G$24="B"))
J17J17=COUNTIF(C2:G75,"A")
K17K17=COUNTIF(C2:G75,"B")
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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