ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using Countif with multiple criteria in the same column. (https://www.excelbanter.com/excel-discussion-misc-queries/60085-using-countif-multiple-criteria-same-column.html)

Harley

Using Countif with multiple criteria in the same column.
 
I need to count different criteria from the same column. For example, under
the column Names, the criteria for one breakout might be Tom, Beth, John,
Roger; the next breakout might be Joe, Sue, Randy, Bob.

ExcelBanter AI

Answer: Using Countif with multiple criteria in the same column.
 
Sure, you can use the COUNTIFS function to count multiple criteria from the same column. Here's how you can do it:
  1. First, select the cell where you want to display the count result.
  2. Then, type the formula "=COUNTIFS(" in the formula bar.
  3. After that, select the range of cells that contain the Names column. For example, if the Names column is in column A and has data in rows 2 to 100, select the range A2:A100.
  4. Next, type a comma "," to separate the first criterion.
  5. Then, type the first criterion in quotes. For example, if the first criterion is "Tom", type "Tom" in quotes.
  6. Type another comma "," to separate the second criterion.
  7. Type the second criterion in quotes. For example, if the second criterion is "Beth", type "Beth" in quotes.
  8. Repeat steps 6 and 7 for each additional criterion you want to count. For example, if you want to count Tom, Beth, John, and Roger, you would type:

    =COUNTIFS(A2:A100,"Tom",A2:A100,"Beth",A2:A100,"Jo hn",A2:A100,"Roger")
  9. If you want to count a different set of criteria, simply replace the criteria in the formula with the new criteria. For example, if you want to count Joe, Sue, Randy, and Bob, you would type:

    =COUNTIFS(A2:A100,"Joe",A2:A100,"Sue",A2:A100,"Ran dy",A2:A100,"Bob")
  10. Press Enter to complete the formula. The cell will display the count result.

That's it! You can use this formula to count multiple criteria from the same column in Excel.

rsenn

Using Countif with multiple criteria in the same column.
 

Assuming you want a count of "Ted" plus "Bob" you could use a formula
similar to this.

=COUNTIF(C14:C19,"Ted")+COUNTIF(C14:C19,"Bob")


--
rsenn
------------------------------------------------------------------------
rsenn's Profile: http://www.excelforum.com/member.php...o&userid=29050
View this thread: http://www.excelforum.com/showthread...hreadid=492933


Peo Sjoblom

Using Countif with multiple criteria in the same column.
 


=SUMPRODUCT(COUNTIF(A1:A10,{"Tom";"Beth";"John"}))



--
Regards,

Peo Sjoblom

(No private emails please)


"Harley" wrote in message
...
I need to count different criteria from the same column. For example,
under
the column Names, the criteria for one breakout might be Tom, Beth, John,
Roger; the next breakout might be Joe, Sue, Randy, Bob.



LeonC247

Thanks for these posts. They were very helpful

u828576

If you take =SUMPRODUCT(COUNTIF(A1:A10,{"Tom";"Beth";"John"})) , is it possible to setup 3 named ranges to hold 3 separate values instead of typing them directly into the formula i.e.

=SUMPRODUCT(COUNTIF(A1:A10,{namedrange1;namedrange 2;namedrange3}))

I tried but couldnt figure it out.....

:-)

Quote:

Originally Posted by Peo Sjoblom (Post 202458)
=SUMPRODUCT(COUNTIF(A1:A10,{"Tom";"Beth";"John"}))



--
Regards,

Peo Sjoblom

(No private emails please)


"Harley" wrote in message
...
I need to count different criteria from the same column. For example,
under
the column Names, the criteria for one breakout might be Tom, Beth, John,
Roger; the next breakout might be Joe, Sue, Randy, Bob.



All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com