COUNTIF based on 2 criteria

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,046
I am using this formula

=SUMPRODUCT(--(E10:I10="TRAINING"),--(E10:I10="LEAVE"))


To count how many times the word LEAVE and TRAINING appear .

I have the word training in E10 and LEAVE in F10 but it counts zero????


Have I missed something ??
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
You have probably stray spaces around the entries in the relevant ranges. Try to remove them. The TrimAll macro and ASAP Utilities are the best tools to solve that problem.
 

maytas

New Member
Joined
Sep 5, 2006
Messages
18
Hi,
Try =SUMPRODUCT(--(E10:I10="TRAINING")+(E10:I10="LEAVE"))
or =SUMPRODUCT(--(E10:I10="TRAINING")--(E10:I10="LEAVE"))
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Many thanks, removing the comma did the trick, thank you

Comma as list separator is used on US systems. It's semi-colon [i.e., ;] in Europe.

If E10 = TRAINING and F10 = LEAVE, are you wanting to count 1 or 2?
 

Forum statistics

Threads
1,175,982
Messages
5,900,703
Members
434,845
Latest member
rowell123

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
Top