Note: The other languages of the website are Google-translated. Back to English

How to countif with multiple criteria in Excel?


Countif with multiple criteria in same column


Count cells with multiple criteria based on text value

For example, I have the following data which contains some products, and now I need to count the number of KTE and KTO which are populated in the same column, see screenshot:

To get the number of KTE and KTO, please enter this formula:

=COUNTIF($A$2:$A$15,"KTE")+COUNTIF($A$2:$A$15,"KTO")

And then press Enter key to get the number of these two products. See screenshot:

Notes:

1. In the above formula: A2:A15 is the data range that you want to use, KTE and KTO are the criteria that you want to count.

2. If there are more than two criteria that you want to count in one column, just use =COUNTIF(range1, criteria1) + COUNTIF(range2, criteria2) + COUNTIF(range3, criteria3)+…

  • Tips:
  • Another compact formula also can help you to solve this problem: =SUMPRODUCT(COUNTIF($A$2:$A$15,{"KTE";"KTO"})), and then press Enter key to get the result.
  • And you can add the criteria just as =SUMPRODUCT(COUNTIF(range,{ "criteria1";"criteria2";"criteria3";"criteria4"…})).


Count cells with multiple criteria between two values

If you need to count the number of cells that the value is between two given numbers, how to solve this job in Excel?

Take the below screenshot as an example, I want to get the result of the number that is between 200 and 500. Please do with these formulas:

Enter this formula into a blank cell where you want to locate the result:

=COUNTIF($B$2:$B$15,">200")-COUNTIF($B$2:$B$15,">500")

And then press Enter key to get the result as you need, see screenshot:

Note: In the above formula:

  • B2:B15 is the cell range that you want to use, >200 and >500 are the criteria you want to count the cells;
  • the whole formula means, to find the number of cells that have a value greater than 200 and then subtract the count of cells with a value greater than 500.
  • Tips:
  • You can also apply the COUNTIFS function to deal with this task, please type this formula: =COUNTIFS($B$2:$B$15,">200",$B$2:$B$15,"<500"), and then press Enter key to get the result.
  • And you can add the criteria just as =COUNTIFS(range1,"criteria1",range2,"criteria2",range3,"criteria3",...).

Count cells with multiple criteria between two dates

To count the cells based on date range, the COUNTIF and COUNTIFS functions can do you a favor as well.

For example, I want to count the cell numbers that the date is between 5/1/2019 and 8/1/2019 in a column, please do as this:

Enter the below formula into a blank cell:

=COUNTIFS($B$2:$B$15, ">=5/1/2019", $B$2:$B$15, "<=8/1/2019")

And then press Enter key to get the count number, see screenshot:

Note: In the above formula:

  • B2:B15 is the cell range that you want to use;
  • >=5/1/2018 and <=8/1/2019 are the date criteria you want to count the cells;

Click to know more about the COUNTIF function...



Countif with multiple criteria in same column with a useful feature

If you have Kutools for Excel, with its Select Specific Cells feature, you can quickly select the cells with specific text or cells between two numbers or dates, and then get the number you need.

Tips:To apply this Select Specific Cells feature, firstly, you should download the Kutools for Excel, and then apply the feature quickly and easily.

After installing Kutools for Excel, please do as this:

1. Select the list of cells that you want to count cells based on criteria, and then click Kutools > Select > Select Specific Cells, see screenshot:

2. In the Select Specific Cells dialog box, please set the operations as you need, and then click OK, the specific cells have been selected and the number of the cells are shown in the prompt box as below screenshots shown:

Note: This feature also can help you to select and count the cells between two specific numbers or dates as the following screenshots shown:

Download and free trial Kutools for Excel Now!


Countif with multiple criteria in multiple columns

If there are multiple criteria in multiple columns, such as following screenshot shown, and I want to get the number of KTE whose order is greater than 300 and the name is Ruby.

Please type this formula into the desired cell:

=COUNTIFS($A$2:$A$15,"KTE",$B$2:$B$15,">300",$C$2:$C$15,"Ruby")

and then press Enter key to get the number of KTE which you need.

Notes:

1. A2:A15 and KTE are the first range and criterion you need, B2:B15 and >300 are the second range and criterion you need, and the C2:C15 and Ruby are the third range and criterion you based on.

2. If there are more criteria you need based on, you just need to add the range and criteria within the formula, such as: =COUNTIFS(range1, criteria1, range2, criteria2, range3, criteria3, range4, criteria4, … )

  • Tips:
  • Here is another formula also can help you: =SUMPRODUCT(--($A$2:$A$15="KTE"),--($B$2:$B$15>300),--($C$2:$C$15="Ruby")), and then press Enter key to get the result.

Click to know more about the COUNTIFS function...


More relative count cells articles:

  • Countif To Calculate The Percentage In Excel
  • For example, I have a summary report of a research paper, and there are three options A, B, C, now I want to calculate the percentage of each these three options. That is to say, I need to know the option A accounts for the percentage of all options.
  • Countif A Specific Value Across Multiple Worksheets
  • Supposing, I have multiple worksheets which contain the following data, and now, I want to get the number of occurrence of a specific value “Excel” from theses worksheets. How could I count specific values across multiple worksheet?
  • Countif Partial String/Substring Match In Excel
  • It’s easy to countif cells filled with certain strings, but do you know how to countif cells containing only partial string or substrings in Excel? This article will introduce a couple of methods to solve it quickly.
  • Count All Cells Except A Specific Value In Excel
  • If you have the word "Apple" scattered among a list of values, now, you just want to count the number of cells which are not "Apple" to get the following result. In this article, I will introduce some methods to solve this task in Excel.
  • Count Cells If One Of Multiple Criteria Met In Excel
  • The COUNTIF function will help us count cells containing one criterion, and the COUNTIFS function can help up count cells containing a set of conditions or criteria in Excel. What if counting cells if contains one of multiple criteria? Here I will share the ways to count cells if contain X or Y or Z … etc. in Excel.

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (59)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
=COUNTIFS(B3:B109,"OPEN",I3:I109,"
This comment was minimized by the moderator on the site
In your example above, how to find order>=200 for product KTE and KTO but not using countifs(..."KTE"...) +countifs(..."KTO"...)
This comment was minimized by the moderator on the site
On formula =COUNTIFS(A2:A11,"KTE",B2:B11,">=200") above. Why can you not note cell "A2" as the criteria instead of spelling out KTE. I know in this example KTE is short but not the case in my sheet.
This comment was minimized by the moderator on the site
On formula =SUMPRODUCT(COUNTIF(range,{ "criteria";"criteria";"criteria";"criteria"…})), what if i want the content from some cell to form the criterias? Like this =SUMPRODUCT(COUNTIF(A:A,{C1;C1&",*";"*,"&C1,"*,"C1&",*"})), here i got syntax error. Seems it's illegal to use cell reference in {} array.
This comment was minimized by the moderator on the site
SUMPRODUCT(COU NTIF(A:A,{C1;C1 &",*";"*,"&C1," *,"C1&",*"})) In this, C1 needs to be given in double quotes. Please check and verify
This comment was minimized by the moderator on the site
how to count a , b , c , d in excel . i want to count only a b d in excel not c .

please tell formula
This comment was minimized by the moderator on the site
A
B
C
D

=COUNTIF(B2:B5,"A")+COUNTIF(B2:B5,"B")+COUNTIF(B2:B5,"D")
This comment was minimized by the moderator on the site
I have a spreadsheet where I need to count column v if it is equal to "EQ" and if columns j thru u are blank.
This comment was minimized by the moderator on the site
i'm trying to count the number of cells where the date is within a certain range, no problems, i have the formula =SUMPRODUCT((P8:P253>=DATEVALUE("1/7/2017"))*(P8:P253<=DATEVALUE("31/07/2017"))) also trying to count where the product of another cell is another condition, say A1, again no problems, i have =COUNTIF(E8:E253,"A1") but how do i combine the two as conditional where i get the number of cells between a certain date range that contain a specific entry? thanks
This comment was minimized by the moderator on the site
i'm trying to count the number of cells where the date is within a certain range, no problems, i have the formula =SUMPRODUCT((P8:P253>=DATEVALUE("1/7/2017"))*(P8:P253<=DATEVALUE("31/07/2017"))) also trying to count where the product of another cell is another condition, say A1, again no problems, i have =COUNTIF(E8:E253,"A1") but how do i combine the two as conditional where i get the number of cells between a certain date range that contain a specific entry? thanks
This comment was minimized by the moderator on the site
Hello, Paul,
the following formula may help you:
=SUMPRODUCT(--($B$2:$B$11>=$E$2), --($B$2:$B$11<=$E$3), --($A$2:$A$11=$E$1))
please view the screenshot for the details, you should change the cell references to your need.

Hope it can help you!
Thank you!
This comment was minimized by the moderator on the site
I have a spreadsheet where I am trying to find a particular value in a column, from those that were found I need to find another value in another column, and a third column. Would this be COUNTIF calculation, how could I do this?
This comment was minimized by the moderator on the site
I'm trying to find a formula that helps me tally how many unique numbers I have in column A for every row that has numerical value (a date) in column B. Column A has multiple duplicates. Column B also has text cells and blank cells. Is that even possible?
This comment was minimized by the moderator on the site
=IF(Working!C3=Working!B7,SUM(COUNTIFS(Gender,"Male",Category,{"Bombay","Pune"},Class,{"1","2","3","4"})))


Am not getting the correct answer for this, getting output for only 1st criteria.

*(Working - Sheet Name)

Kindly help
This comment was minimized by the moderator on the site
Hello, Waseem,
Can you give an example of your problem?
You can attach a screenshot here!
Thank you!
This comment was minimized by the moderator on the site
Thanks for ua consideration... Below is the formula again..


If B14 matches with A17, then I want the number of counts of 'Male' from Bombay and Pune and they should be in class 1 to class 4.. (For this answer should be 3, but am not getting that)

=IF(B14=A17,SUM(COUNTIFS(Gender,"Male",Category,{"Bombay","Pune"},Class,{"1","2","3","4"})))
This comment was minimized by the moderator on the site
Here is the screenshot..
This comment was minimized by the moderator on the site
Hello, you can upload the screenshot from here:
This comment was minimized by the moderator on the site
I tried yesterday,, N trying again now,, hope it uploads
This comment was minimized by the moderator on the site
I dono its not uploading image, trying again,,
This comment was minimized by the moderator on the site
ColA, ColB

Count Range is in ColB, nd Count Criteria is in Col A how can I count , pls give soln
This comment was minimized by the moderator on the site
lets say I have these values, 1 to 1.5 will be a 1, 1.6 to 3 will be a 2, 3.1 to 4.5 will be a 3 and 4.6 to 6 will be 4. How do I put that formula for several values, like lets say I have a list with 100 items and their values vary between 1 and 6. So every time I log in a number it will automatically give me the value. Thank you.
This comment was minimized by the moderator on the site
I have a column with Multiple names and i wanted to find the count of the names except a perticular name. Can some body help me??
Column Values: a b a b c d e f a b a x y z (Here i want count of a & b & c) without using countif(A:A,"a")+countif(A:A,"b")+countif(A:A,"c").
This comment was minimized by the moderator on the site
=COUNTIFS(rng,"<>x",rng,"<>y")
Where rng is the range e.g. A:A
X or why is the thing you do not want to count
This comment was minimized by the moderator on the site
If the range is A:H, how can apply the formula..?
This comment was minimized by the moderator on the site
Hello,

Good day ...

We have two results from an item number from different location

that will show like
Eg.
C1 C2 C3
item#123 Required Not Required not Required

From this this 2 answers the final answer will be 'required' if required available on column

If 'required' not available then answer will be 'Not Required'


In final cell I would like to get one answer
This comment was minimized by the moderator on the site
Hi,

I have a large document of data in the below format:

Offer Start date End date
Offer 1 12/08/2018 18/08/2018
Offer 2 13/08/2018 26/08/2018
Offer 3 13/08/2018 26/08/2018
Offer 4 14/08/2018 01/09/2018
Offer 5 20/08/2018 26/08/2018
Offer 6 27/08/2018 08/09/2018
Offer 7 09/08/2018 12/08/2018
Offer 8 08/08/2018 18/08/2018

I need to calculate a number of offers avaliable each week. The final document should be in the format below:

WeekNum Start date End date Offer count
31 30/07/2018 05/08/2018
32 06/08/2018 12/08/2018
33 13/08/2018 19/08/2018
34 20/08/2018 26/08/2018
35 27/08/2018 02/09/2018
36 03/09/2018 09/09/2018
37 10/09/2018 16/09/2018


In theory, it's relatively easy. You can use COUNTIFS to calculate cells when the offer end date is between the week start date and week end date. The problem however is when offer lasts for more than 1 week. Eg. Offer 8 lasts until December 31 which means it needs to be counted as one every week from week 32 to week 53. Do you have any ideas how this could be calculated?


Thanks!
This comment was minimized by the moderator on the site
Okay I'm soooo stuck with this formula. Here's what I have
= SUMPRODUCT(--(F2:F77=FALSE),--(G2:G77=FALSE))

Now I also have a column H. I need the formula to count if G and H are false but if I do
= SUMPRODUCT(--(F2:F77=FALSE),--(G2:H77=FALSE))

or
= SUMPRODUCT(--(F2:F77=FALSE),--(G2:G77=FALSE)--(H2:H77=FALSE))

it won't allow either. Please help!
Thanks
This comment was minimized by the moderator on the site
Hi, Jason,
The formula in this article you applied is based on the criteria "and", and your problem is to apply "or", so you can use the following formula to count all "FALSE" in the two columns:

=SUM(COUNTIF(F2:G77,{"False"})).

Please try it, hope it can help you!
This comment was minimized by the moderator on the site
please assist. I want to count the number of blank columns next to a certain name.

I am trying to use "=countifs", but struggling with the blank part...


for example:
column A Column B
Lesley Nico
Lesley Sipho
Lesley
Lesley Floyd
Bronz Sam
Bronz Gift
Bronz
Bronz

Result should be:
Lesley 1
Bronz 2
This comment was minimized by the moderator on the site
Hi, Patricia,
To count all blank cells based on another column data, the below formula may help you, please try it.

=COUNTIFS(A2:A15,"Lesley",B2:B15,"")

Hope it can help you!
This comment was minimized by the moderator on the site
I have a work Count the students branch wise and course wise i have Ex. A1 course like B.tech or Diploma A2 Have Branch EEE,ECE and soon i want count diploma all banchs and btech all banchs any formula for that
sheet enclosed
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations