Tcurtis

Board Regular
Joined
Aug 15, 2009
Messages
149
Good morning! I have a issue using countifs. I have a column of data that contains 3 characters - I, M and B. I want to only count I and M. I am currently using {=COUNTIFS(Paste!P:P,"I",Paste!P:P,"M ")} without {} but I only get 0 as the result.
Paste is the worksheet that the data is on and P is the column that contains the data. This seems pretty straight forward to do but for some reason I cannot get the formula to count the criteria I have set up.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try

=SUM(COUNTIF(Paste!P:P,{"I","M"}))

OR

If I M and B are the ONLY options for column P (no blanks either) then simply
=COUNTIF(Paste!P:P,"<>B")
 
Upvote 0
Hi,

Try this one. Note I cut this down to 5000 rows because using full columns slows things down too much. Use more rows if you need to but avoid full columns.


=SUMPRODUCT(--(ISNUMBER(MATCH(Paste!P1:P5000,{"M","I"},0))))
 
Upvote 0

Forum statistics

Threads
1,216,178
Messages
6,129,326
Members
449,501
Latest member
Amriddin

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