Countif with based on multiple criteria

Lukma

Board Regular
Joined
Feb 12, 2020
Messages
240
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi friends

Please i was wondering if anyone could help out with a formula that could count based on multiple criteria

i need to count a range of column with different value the meet and do not meet that if ( Half equal 10 and Full equal 16) so i need to count are many that meet and do not meet for each criteria

here is my table appreciate if anyone can help me with a formula that can count based on multiple criteria

Book2
ABCDEFGHIJKLMNO
1
2FullHalf
31610
4MeetDo Not meet
5A-221Half9812192510101015
6A-221Full102515191614164512
7A-222Half9812192510101015
8A-223Full102515191614164512
9A-224Half9812192510101015
10A-225Half9812192510101015
11
Sheet1
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Place this formula in cell M5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,">=" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,">=" & $C$3),""))
and this formula un cell N5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,"<" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,"<" & $C$3),""))
and copy down for all rows.
 
Upvote 0
Another way.

bRoster.xlsx
ABCDEFGHIJKLMN
1
2FullHalf
31610
4MeetDo Not meet
5A-221Half981219251010101536
6A-221Full10251519161416451227
7A-222Half981219251010101536
8A-223Full10251519161416451227
9A-224Half981219251010101536
10A-225Half981219251010101536
Sheet2
Cell Formulas
RangeFormula
M5:M10M5=SUMPRODUCT(--(D5:L5=LOOKUP(C5,$B$2:$C$2,$B$3:$C$3)))
N5:N10N5=COUNTA(D5:L5)-M5
 
Upvote 0
Follow-up:

Since you did not post any expected results, your expected output is a little unclear, and the two replies made different assumptions.
I assumed that you wanted to do the following:
- for Half: count anything 10 and above
- for Full: count anything 16 and above


lrobbo314 assumes that you were looking for those values to count if they were EXACTLY 10 and 16, respectively.

Like I said, I am not sure which one you were looking for, but if lrobbo314's assumption is correct, you could also get it using my method, with a few minor changes:
M5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,$B$3),IF($C5=$C$2,COUNTIF($D5:$L5,$C$3),""))
N5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,"<>" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,"<>" & $C$3),""))
 
Upvote 0
Place this formula in cell M5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,">=" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,">=" & $C$3),""))
and this formula un cell N5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,"<" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,"<" & $C$3),""))
and copy down for all rows.

Hi Joe4
Thanks so much with the formula but still i need the formula to count column with blue as meet which will be 5 that meet the criteria and the red will be do not meet which will count will be 4

appreciate

Book2
ABCDEFGHIJKLMNO
1
2FullHalf
31610
4MeetDo Not meet
5A-221Half981219251010101572
6A-221Full10251519161416451254
7A-222Half981219251010101572
8A-223Full10251519161416451254
9A-224Half981219251010101572
10A-225Half981219251010101572
11
Sheet1
Cell Formulas
RangeFormula
M5:M10M5=IF($C5=$B$2,COUNTIF($D5:$L5,">=" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,">=" & $C$3),""))
N5:N10N5=IF($C5=$B$2,COUNTIF($D5:$L5,"<" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,"<" & $C$3),""))
 
Upvote 0
Another way.

Hi.​

Thanks so much both Joe4 & Irobbo314 with the formula, Column M5 to consider as 5 that meet and column N to be consider as 4 that do not meet

Meet Do note Meet
M=count 5 N = 4

Appreciate with any formula that can give this count based on the criteria range
 
Upvote 0
Thanks so much with the formula but still i need the formula to count column with blue as meet which will be 5 that meet the criteria and the red will be do not meet which will count will be 4
Wow, OK, so it appears that you actually want to count anything that is that number (10) and lower. Is that correct (I am not sure how we were supposed to figure that out from the original post!).

If that is the case, then use:
M5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,"<=" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,"<=" & $C$3),""))
N5:
Excel Formula:
=IF($C5=$B$2,COUNTIF($D5:$L5,">" & $B$3),IF($C5=$C$2,COUNTIF($D5:$L5,">" & $C$3),""))
 
Upvote 0
Solution
Hi

thanks great so releave thanks a million Joe4
 
Upvote 0
You are welcome.

I hope you understand how the formula works. If not, feel free to ask any questions.
 
Upvote 0
hI Joe4

Please i need to Ask supposing the value are in time format will it still count and ignore blanks cells

if it is possible i would prefer the time format count

Appreciate your feedback with a formula that could count if the value in cell are time format
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,871
Members
449,097
Latest member
dbomb1414

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