using count if function

aryanaveen

Board Regular
Joined
Jan 5, 2015
Messages
104
Hi All,

I am looking for a formula where I can count based on 2 criteria.

Example
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Naveen[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Praveen[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]f[/TD]
[TD]f[/TD]
[TD]f[/TD]
[TD]f[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Abhay[/TD]
[TD]d[/TD]
[TD]d[/TD]
[TD]g[/TD]
[TD]g[/TD]
[TD]g[/TD]
[TD]f[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Prakash[/TD]
[TD]d[/TD]
[TD]f[/TD]
[TD]i[/TD]
[TD]a[/TD]
[TD]i[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Giri[/TD]
[TD]d[/TD]
[TD]j[/TD]
[TD]f[/TD]
[TD]j[/TD]
[TD]k[/TD]
[TD]a[/TD]
[/TR]
</tbody>[/TABLE]

In the above table I want to count number of "A" in range "C1:H5" where Column B is having "Naveen". Please note "Naveen" can be in any row under column B.


Please help
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Please note "Naveen" can be in any row under column B.

Hi, if Naveen can only appear once in column B then you can try this:


Excel 2013/2016
ABCDEFGHIJ
1ABCDEFGHNaveen
21NaveenABAACD3
32PraveenCDffff
43Abhayddgggf
54Prakashdfiaia
65Giridjfjka
Sheet1
Cell Formulas
RangeFormula
J2=COUNTIFS(INDEX($C$2:$H$6,MATCH(J1,$B$2:$B$6,0),0),"A")
 
Upvote 0
Have a look at this:
=SUMPRODUCT(--(B1:B5="Naveen"),--EXACT(C1:C5,"A"))
This is case sensitive for "A"
 
Upvote 0
Try
Code:
=COUNTIFS($B$1:$B$5,"Naveen",$C$1:$C$5,"A")+COUNTIFS($B$1:$B$5,"Naveen",$D$1:$D$5,"A")+COUNTIFS($B$1:$B$5,"Naveen",$E$1:$E$5,"A")+COUNTIFS($B$1:$B$5,"Naveen",$F$1:$F$5,"A")+COUNTIFS($B$1:$B$5,"Naveen",$G$1:$G$5,"A")+COUNTIFS($B$1:$B$5,"Naveen",$H$1:$H$5,"A")
 
Upvote 0

Forum statistics

Threads
1,224,222
Messages
6,177,221
Members
452,765
Latest member
Erka Gizli

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