How to use Excel COUNTIFS and COUNTIF with multiple criteria

The tutorial explains how to use COUNTIFS and COUNTIF formulas with multiple criteria in Excel based on AND as well as OR logic. You will find a number of examples for different data types - numbers, dates, text, wildcard characters, non-blank cells and more.

Of all Excel functions, COUNTIFS and COUNTIF are probably most often mixed up because they look very much alike and both are purposed for counting cells based on the specified criteria.

The difference is that COUNTIF is designed for counting cells with a single condition in one range, whereas COUNTIFS can evaluate different criteria in the same or in different ranges. The aim of this tutorial is to demonstrate different approaches and help you choose the most efficient formula for each particular task.

Excel COUNTIFS function - syntax and usage

The Excel COUNTIFS function counts cells across multiple ranges based on one or several conditions. The function is available in Excel 365, 2021, 2019, 2016, 2013, Excel 2010, and Excel 2007, so you can use the below examples in any Excel version.

COUNTIFS syntax

The syntax of the COUNTIFS function is as follows:

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
  • criteria_range1 (required) - defines the first range to which the first condition (criteria1) shall be applied.
  • criteria1 (required) - sets the condition in the form of a number, cell reference, text string, expression or another Excel function. The criteria defines which cells shall be counted and can be expressed as 10, "<=32", A6, "sweets".
  • [criteria_range2, criteria2]… (optional) - these are additional ranges and their associated criteria. You can specify up to 127 range/criteria pairs in your formulas.

In fact, you don't have to remember the syntax of the COUNTIF function by heart. Microsoft Excel will display the function's arguments as soon as you start typing; the argument you are entering at the moment is highlighted in bold. The syntax of the Excel COUNTIFS function

Excel COUNTIFS - things to remember!

  1. You can use the COUNTIFS function in Excel to count cells in a single range with a single condition as well as in multiple ranges with multiple conditions. If the latter, only those cells that meet all of the specified conditions are counted.
  2. Each additional range must have the same number of rows and columns as the first range (criteria_range1 argument).
  3. Both contiguous and non-contiguous ranges are allowed.
  4. If the criteria is a reference to an empty cell, the COUNTIFS function treats it as a zero value (0).
  5. You can use the wildcard characters in criteria - asterisk (*) and question mark (?). See this example for full details.

How to use COUNTIFS and COUNTIF with multiple criteria in Excel

Below you will find a number of formula examples that demonstrate how to use the COUNTIFS and COUNTIF functions in Excel to evaluate multiple conditions.

How to count cells with multiple criteria (AND logic)

This scenario is the easiest one, since the COUNTIFS function in Excel is designed to count only those cells for which all of the specified conditions are TRUE. We call it the AND logic, because Excel's AND function works this way.

Formula 1. COUNTIFS formula with multiple criteria

Suppose you have a product list like shown in the screenshot below. You want to get a count of items that are in stock (value in column B is greater than 0) but have not been sold yet (value is column C is equal to 0).

The task can be accomplished by using this formula:

=COUNTIFS(B2:B7,">0", C2:C7,"=0")

And the count is 2 ("Cherries" and "Lemons"): Counting cells with multiple criteria based on AND logic

Formula 2. COUNTIFS formula with two criteria

When you want to count items with identical criteria, you still need to supply each criteria_range / criteria pair individually.

For example, here's the right formula to count items that have 0 both in column B and column C:

=COUNTIFS($B$2:$B$7,"=0", $C$2:$C$7,"=0")

This COUNTIFS formula returns 1 because only "Grapes" have "0" value in both columns. COUNTIFS formula with identical criteria

Using a simpler formula with a single criteria_range like COUNTIFS(B2:C7,"=0") would yield a different result - the total count of cells in the range B2:C7 containing a zero (which is 4 in this example).

How to count cells with multiple criteria (OR logic)

As you have seen in the above examples, counting cells that meet all of the specified criteria is easy because the COUNTIFS function is designed to work this way.

But what if you want to count cells for which at least one of the specified conditions is TRUE, i.e. based on the OR logic? Overall, there are two ways to do this - by adding up several COUNTIF formulas or using a SUM COUNTIFS formula with an array constant.

Formula 1. Add up two or more COUNTIF or COUNITFS formulas

In the table below, supposing you want to count orders with the "Cancelled" and "Pending" status. To have it doen, you can simply write 2 regular Countif formulas and add up the results:

=COUNTIF($C$2:$C$11,"Cancelled") + COUNTIF($C$2:$C$11,"Pending") Counting cells that meet any of the specified criteria

In case each of the functions is supposed to evaluate more than one condition, use COUNTIFS instead of COUNTIF. For example, to get the count of "Cancelled" and "Pending" orders for "Apples" use this formula:

=COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Cancelled") + COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Pending") Another formula to count cells with multiple criteria and OR logic

Formula 2. SUM COUNTIFS with an array constant

In situations when you have to evaluate a lot of criteria, the above approach is not the best way to go because your formula would grow too big in size. To perform the same calculations in a more compact formula, list all of your criteria in an array constant, and supply that array to the criteria argument of the COUNTIFS function. To get the total count, embed COUNTIFS inside the SUM function, like this:

SUM(COUNTIFS(range,{"criteria1","criteria2","criteria3",…}))

In our sample table, to count orders with the status "Cancelled" or "Pending" or "In transit", the formula would go as follows:

=SUM(COUNTIFS($C$2:$C$11, {"cancelled", "pending", "in transit"})) A more compact formula to count cells with multiple criteria and OR logic

In a similar manner, you can count cells based on two or more criteria_range / criteria pairs. For instance, to get the number of "Apples" orders that are "Cancelled" or "Pending" or "In transit", use this formula:

=SUM(COUNTIFS($A$2:$A$11,"apples",$C$2:$C$11,{"cancelled","pending","in transit"})) Counting cells with multiple criteria_range / criteria pairs and OR logic

You can find a few more ways to count cells with OR logic in this tutorial: Excel COUNTIF and COUNTIFS with OR conditions.

How to count numbers between 2 specified numbers

By and large, COUNTIFS formulas for numbers fall into 2 categories - based on several conditions (explained in the above examples) and between the two values you specify. The latter can be accomplished in two ways - by using the COUNTIFS function or by subtracting one COUNTIF from another.

Formula 1. COUNTIFS to count cells between two numbers

To find out how many numbers between 5 and 10 (not including 5 and 10) are contained in cells C2 through C10, use this formula:

=COUNTIFS(C2:C10,">5", C2:C10,"<10") A COUNTIFS formula to count numbers between X and Y

To include 5 and 10 in the count, use the "greater than or equal to" and "less than or equal to" operators:

=COUNTIFS(B2:B10,">=5", B2:B10,"<=10")

Formula 2. COUNTIF formulas to count numbers between X and Y

The same result can be achieved by subtracting one Countif formula from another. The first one counts how many numbers are greater than the lower bound value (5 in this example). The second formula returns the count of numbers that are greater than the upper bound value (10 in this case). The difference between the first and second number is the result you are looking for.

  • =COUNTIF(C2:C10,">5")-COUNTIF(C2:C10,">=10") - counts how many numbers greater than 5 and less than 10 are in the range C2:C10. This formula will return the same count as shown in the screenshot above.
  • =COUNTIF(C2:C10, ">=5")-COUNTIF(C2:C10, ">10") - the formula counts how many numbers between 5 and 10 are in the range C2:C10, including 5 and 10.

How to use cell references in COUNTIFS formulas

When using logical operators such as ">", "<", "<=" or ">=" together with cell references in your Excel COUNTIFS formulas, remember to enclose the operator in "double quotes" and
add an ampersand (&) before a cell reference to construct a text string.

In a sample dataset below, let's count "Apples" orders with amount greater than $200. With criteria_range1 in cells A2:A11 and criteria_range2 in B2:B11, you can use this formula:

=COUNTIFS($A$2:$A$11, "Apples", $B$2:$B$11, ">200")

Or, you can input your criteria values in certain cells, say F1 and F2, and reference those cells in your formula:

=COUNTIFS($A$2:$A$11, $F$1, $B$2:$B$11, ">"&$F$2)

Please notice the use of absolute cell references both in the criteria and criteria_range arguments, which prevents the formula from being broken when copied to other cells. Using cell references in COUNTIFS formulas

For more information about the use of an ampersand in COUNTIF and COUNTIFS formulas, please see Excel COUNTIF - frequently asked questions.

How to use COUNTIFS with wildcard characters

In Excel COUNTIFS formulas, you can use the following wildcard characters:

  • Question mark (?) - matches any single character, use it to count cells starting and/or ending with certain characters.
  • Asterisk (*) - matches any sequence of characters, you use it to count cells containing a specified word or a character(s) as part of the cell's contents.

Tip. If you want to count cells with an actual question mark or asterisk, type a tilde (~) before an asterisk or question mark.

Now let's see how you can use a wildcard char in real-life COUNTIFS formulas in Excel. Suppose, you have a list of projects in column A. You wish to know how many projects are already assigned to someone, i.e. have any name in column B. And because we are learning how to use the COUNTIFS function with multiple criteria, let's add a second condition - the End Date in column D should also be set.

Here is the formula that works a treat:

=COUNTIFS(B2:B10,"*",D2:D10,"<>"&""))

Please note, you cannot use a wildcard character in the 2nd criteria because you have dates rather that text values in column D. That is why, you use the criteria that finds non-blank cells: "<>"&"" The COUNTIFS formula to count entries containing any text in one column and non-blank cells in another column.

COUNTIFS and COUNTIF with multiple criteria for dates

The COUNTIFS and COUNTIF formulas you use for dates are very much similar to the above formulas for numbers.

Example 1. Count dates in a specific date range

To count the dates that fall in a certain date range, you can also use either a COUNTIFS formula with two criteria or a combination of two COUNTIF functions.

For example, the following formulas count the number of dates in cells C2 through C10 that fall between 1-Jun-2014 and 7-Jun-2014, inclusive:

=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, "<=6/7/2014")

=COUNTIF(C2:C9, ">=6/1/2014") - COUNTIF(C2:C9, ">6/7/2014") The COUNTIF formula with 2 conditions to count dates in a specific date range

Example 2. Count dates with multiple conditions

In the same manner, you can use a COUNTIFS formula to count the number of dates in different columns that meet 2 or more conditions. For instance, the below formula will find out how many products were purchased after the 20th of May and delivered after the 1st of June:

=COUNTIFS(C2:C9, ">5/1/2014", D2:D9, ">6/7/2014") The COUNTIF formula to count dates with multiple conditions

Example 3. Count dates with multiple conditions based on the current date

You can use Excel's TODAY() function in combination with COUNTIF to count dates based on the current date.

For example, the following COUNTIF formula with two ranges and two criteria will tell you how many products have already been purchased but not delivered yet.

=COUNTIFS(C2:C9, "<"&TODAY(), D2:D9, ">"&TODAY()) The COUNTIF formula to count dates with multiple conditions based on the current date

This formula allows for many possible variations. For instance, you can tweak it to count how many products were purchased more than a week ago and are not delivered yet:

=COUNTIFS(C2:C9, "<="&TODAY()-7, D2:D9, ">"&TODAY())

This is how you count cells with multiple criteria in Excel. I hope you will find these examples helpful. Anyway, I thank you for reading and hope to see you on our blog next week!

2039 comments

  1. Good Afternoon,
    I have created a checklist in Excel with checkboxes under each heading (3 headings) with the option of TRUE,FALSE or #N/A (as some of the items may not be applicable). I have assigned a cell to each check box. I am trying to capture the completion rate of the items required in my checklist (both when required and/or applicable information has been received). I have used COUNTIF to capture the TRUE data in each subheading, but I cant seem to figure out a formula to capture the required data and additional data when applicable to score as available points and actual points. Any ideas?

  2. how can i found the dates which is marked as leave in one month attendace.

    like we have mentioned all dates from 1 to 30 Aug'18 in one row continuesly
    under that one employee attendance was mentioned like present and leave

    only two days 17 Aug 18 and 27 Aug 18 was on leave.

    how can i found the leave dates using formula in excel

  3. i have to prepare 24 entries (hourly basis) daily sheet and at the end of month i have to add up 00:00 hrs of every day reading in next sheet. is there any formula which i give it 1 ference cell and it can count and add every 24 cell.

  4. i have to prepare 24 entries (hourly basis) daily sheet and at the end of month i have to add up 00:00 hrs of every day reading in next sheet. is there any formula which i give it 1 ference cell and it can count and add every 24 cell.

  5. Dear all,

    I have faced the problems with xl operations
    for example i have 2 sheets one is abstract and one more is detail sheet
    i want to bring counts from details sheet to abstract sheet how it is possible
    Details sheet columns we have like module column(A,B,C,D), Types(CR,PR,QR), priority(high,low,medium) how to shown counts in abstract sheet ->(module Wise, no. of CR, no of PR, no QR)counts
    Please explain the formula

  6. Hi,
    I need a formula.
    4 columns (Name,Purchase,Sale,City)
    I want if purchase cell contain specific word like Nil other than number then count nil with concatenation of city like
    | date 04-10-2018 | |Date 05-10-2018 |
    Name Purchase Sale City | Name Purchase Sale City
    Peter 10 5 Manchester| Peter Nil Denmark
    Rock Nil Denmark | Rock Nil Manchester
    Sam Nil NewYork | Sam Nil Denmark

    | date 06-10-2018 | |Date 07-10-2018 |
    Name Purchase Sale City | Name Purchase Sale City
    Peter 10 5 Manchester| Peter Nil NewYork
    Rock Nil Denmark | Rock 10 5 Manchester
    Sam Nil NewYork | Sam Nil Denmark

    result should be show

    column name
    count of Nil NewYork | count of Nil Denmark | count of Nil Manchester
    Peter 1NewYork 1Denmark
    Rock 2Denmark 1Manchester
    Sam 2NewYork 2Denmark

    Please give me formula of this statement.

  7. Hi all... I'm looking to countif unique values that occur on a certain date with one type of criteria also occur across a separate date range with different criteria at least once, so if my data set (for columns A, B, C) looks like this

    Date ID Activity
    9/1/18 266 Registered
    9/2/18 233 Registered
    9/3/18 266 creative
    9/4/18 235 budget
    9/5/18 267 creative
    9/6/18 266 creative
    9/7/18 233 creative
    9/8/18 287 creative
    9/9/18 298 budget
    9/10/18 288 budget

    I want to find unique instances of the IDs that registered on 9/1 but then show how many of the unique IDs that registered on 9/1 actually did at least one activity (doesn't matter which) in the first, second, third week following 9/1).

    This (example of week one) isn't working for me:
    =COUNTIFS($A:$A,"=9/1/18,$C:$C,"registration",$A:$A,">=9/1/2018",$A:$A,"<=9/08/2018",$C:$C,"registration")

    Can anyone help?

  8. Seeking a bit more advanced application of this logic. There are many approaches to summarizing data; however, COUNTIFS seems to offer a unique function when comparing data against itself. For instance assume the following data set:

    Material Order Type
    a YO03
    b YO01
    f YO03
    d YO03
    a YO01
    f YO03
    d YO01
    f YO03
    a YO01
    a YO03

    If I enter a function as follows:

    =LARGE(COUNTIFS([Material],[Material],[Order Type],"YO03"),1)

    The result is 3, the count of the most frequent material with Order Type YO03. Combining this with INDEX and MATCH it can return the value associated with 3 as follows:

    =INDEX([Material],MATCH(LARGE(COUNTIFS(([Material],[Material],[Order Type],"YO03"),1),COUNTIFS(([Material],[Material],[Order Type],"YO03"),0))

    This formula returns material f, the material with the most orders of type "YO03". My trouble is I want to evolve this formula to rank based on 5 criteria. I would like a formula that calculates a RANK on five Criteria, by doing a COUNTIF on the same above, then adding a similar rank for order quantity, another order type, and respective order quantity, followed by the row as a tie breaker. I've managed to do this with a helper sheet but I hope to do this in one step. My helper formula looks like this:

    =IF([@Material]="","",1
    +COUNTIFS([Emergency Orders],">"&[@[Emergency Orders]])
    +COUNTIFS([Emergency Orders],[@[Emergency Orders]],[Emergency Quantity],">"&[@[Emergency Quantity]])
    +COUNTIFS([Emergency Orders],[@[Emergency Orders]],[Emergency Quantity],[@[Emergency Quantity]],[Stock Orders],">"&[@[Stock Orders]])
    +COUNTIFS([Emergency Orders],[@[Emergency Orders]],[Emergency Quantity],[@[Emergency Quantity]],[Stock Orders],[@[Stock Orders]],[Stock Quantity],">"&[@[Stock Quantity]])
    +COUNTIFS([Emergency Orders],[@[Emergency Orders]],[Emergency Quantity],[@[Emergency Quantity]],[Stock Orders],[@[Stock Orders]],[Stock Quantity],[@[Stock Quantity]],[Row],"<"&[@Row]))

    I'm struggling to introduce SUM(IF(s)) into this statement and maintain the analysis by material. And perhaps this is just too darn complex to convey in writing?

    • Here is my data:

      ROW Material Order Type Qty
      1 a Emergency 1
      2 b Stock 2
      3 f Emergency 3
      4 d Emergency 2
      5 a Stock 6
      6 f Emergency 3
      7 d Stock 2
      8 f Emergency 6
      9 a Stock 4
      10 a Emergency 3

      I'm working to assign a multilevel rank in one cell to return the material that has the greatest number of emergency orders, than Emergency Qty, Stock Orders, and Stock Qty with ROW as a tie breaker. I've managed to do this with a help column but the analysis takes to long when working through 500k lines. So I'm trying to do this to identify the top 25-50 materials in one step. So far I've assembled the following code but I cannot seem to SUM by ROW the matrix data to return the ranked match. Here is my code so far:

      {=INDEX(Orders[Material],MATCH(0,
      (((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))<(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))))*1+

      IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))<(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))))*1)+

      IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))<(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))))*1))+

      IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock")))),((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Stock"))<(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Stock"))))*1)))),0))}

      • Correction to the equation (I don't see where I can upload the spreadsheet in the comment section):

        {=INDEX(Orders[Material],MATCH(ROW()-2,SMALL(SUM(
        (((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))<(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))))*1+

        IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))<(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))))*1)+

        IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))<(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))))*1))+

        IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))=(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency")))),IF(((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))=(TRANSPOSE(COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock")))),((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Stock"))<(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Stock"))))*1))))),ROW()-1),0))}

        • I got this ridiculous thing to work...with 4 level ranking. Now to add a fifth level tie breaker for materials that have like order activity. Let me know if you have any suggestions. Changing MATCH(0 to MATCH(ROW() will allow next level matches in the array. Here's the code:

          =INDEX(Orders[Material],MATCH(0,

          IF((--(MMULT(--((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))0))))>0,1,0)+

          IF((--(MMULT(--((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))0))))>0,(TRANSPOSE(SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Emergency"))),0)),--(ROW(Orders[Material])>0))))>0,1,0)+

          IF((--(MMULT(--((COUNTIFS(Orders[Material],Orders[Material],Orders[Order Type], "Stock"))0))))>0,1,0)+

          IF((--(MMULT(--((SUMIFS(Orders[Qty],Orders[Material],Orders[Material],Orders[Order Type], "Stock"))0))))>0,1,0),0))

  9. I'm having an issue here:

    for those names that fall under P:P may not match F4 exactly, because of an initial in the name, how would I write this to count if name is similar when looking up on different tab?

    =IFERROR(COUNTIFS('Issues w-out Action Plans'!K:K,"< 30",'Issues w-out Action Plans'!P:P,'MoEVM Summary Level'!F4),"0")

  10. Can someone help me make this formula work?
    =COUNTIF(B33,E33,H33,K33,N33,Q33,T33,W33,Z33,AC33,AF33,AI33,AL33,AO33,AR33,AU33,AX33,BA33,BD33, ">70%")
    I only want these cells condidered in the count if because they contain student data for a paticular test.

    • Dawnica:
      The COUNTIF function should be setup like COUNTIF(Range,Criteria). So in your case if the data range is B33:BD33 and the criteria is values greater than 70 the formula looks like this:
      =COUNTIF(B33:BD33,">"&70)

      • Thanks for the help!
        But what id there are cells in this row that I do not want included in the countif. is it possible to exclude cells?

        That is, in my formula attempt I wanted to get the number of students who scored above 70 on test 1
        When I put in the formula you provided it every cell in the row so it is counting scores above 70 for all tests given so far. Is there a way to do this or would I need a different type of formula entirely?

        • Dawnica:
          What are the other criteria for the tests you want to count? Are they by date or a test number or something else?
          Which version of Excel are you using?

  11. Dears,
    I have three criteria in column "C", "D" and "E"to consider for customers. i want to have another column "F" wherein i would like to get one value after which i shall use the command. But how can i write an if statement which is basically"
    If the value in column "C" is zero, consider the value in Column "D" and if column "D" is zero, then consider the value in column "E".
    Thank you

  12. Hi. I'm looking for help writing a coutif formula. I have a column with a list of dates. I'm looking to count all dates that are greater than TODAY(). I don't know how to write the condition to check each cell in the range against the TODAY() function. Please assist. Thank you!

    • Aaron:
      Here's the formula to accomplish what you want.
      =COUNTIF(J3:J11,">"&TODAY())

      • Aaron:
        You could get a little fancier with:
        ="Dates Greater Than Today"&" "&"="&" "&COUNTIF(J3:J11,">"&TODAY())

        • Aaron:
          Or finally you could put the TODAY() function in another cell and reference that cell in the formula like this:
          ="Dates Greater Than Today"&" "&"="&" "&COUNTIF(J3:J11,">"&K3)

  13. I have a problem...
    1,2,2,2,3,3,6,6,7,8,9= 7 .how to count without repeating the numbers. I mean I must count repeated value only once . I have to get result as 7 , how??

  14. i want to get formula which count same text in a list and decleared it as "good",or "bad"

  15. Hi,

    I'm currently working on trying to find out how many of my students enrolled in week 1 of my course completed and passed my class.

    I am using =countifs(class start date range, ">="&A1, class start date range, "<+"&B2, Student Status range, "completed class and should advance") I get 0 when I have 2 in my sample data that started the course within the date range and advanced.

    What am I doing wrong?

    Thanks in advance for your help!

  16. Hidears
    I have put numbers in A1 and A2 cell and put space in A3 cell and in A4 cell put, =countblank(A1:A3), it returned the value zero and later in A5 cell used =clean(A3) and why not the value in A4 cell showing one!? please help, just started learning excel..

  17. I have a large spreadsheet which tracks my daily food and fluid intake.

    I have a two columns that contain the beverage and the amount consumed (see attached)

    0.4 Beverage - Coffee - Flat White with Skim Milk - Large - Coffee Shop
    0.3 Beverage - Coffee - Flat White with Skim Milk - Medium - Coffee Shop
    0.2 Beverage - Coffee - Flat White with Skim Milk - Small - Coffee Shop
    0.5 Beverage - Soft Drink - Coke - No Sugar
    0.5 Beverage - Soft Drink - Pepsi Max - No Sugar
    0.3 Beverage - Vegetable Juice - Low Sodium - V8
    0.3 Beverage - Coffee - Flat White with Skim Milk - Medium - Coffee Shop
    0.4 Beverage - Soft Drink - Pepsi Max - No Sugar - Vanilla
    0.3 Beverage - Coffee - Flat White with Skim Milk - Medium - Coffee Shop

    I want to count the number of times each similar beverage occurs each day, multiply it by the amount consumed to obtain a total for each beverage each day.
    I have tried countifs, countif, vlookup, match and index and array functions but I cannot seem to get the logic right.

    Help me Obi Wan you're my last hope!! :-)

  18. I was trying for an option to count sequence, including duplicates in date from current to earliest.
    Where seq on C when contains 2 or above , the date sequence to be found.

    PRIMARY DATA UNIQUE_PRO_PUR SEQ ON C SEQUENCE ON B
    APPLE 1_1 04/11/2017 0 1
    ORANGE 1_55 04/02/2017 2 2
    GRAPES 1_57 04/11/2017 0 1
    ORANGE 1_55 04/03/2018 1 2

  19. Hello! I'm trying to get my spreadsheet to add the following up:

    August 2018 Census Regular Agencies/ Third Party TOTAL
    Work Related Incident / Accidents

    Lacerated Wounds 2 0 2
    Incision Wound 0 0 0

    • Had to resend bec comp is not cooperating.

      Hello! I'm trying to get my spreadsheet to add the following up:

      August 2018 Census Regular Agencies/ Third Party TOTAL
      Work Related...

      Lacerated Wounds 2 0 2
      Incision Wound 0 0 0

      Regular should read '1' instead of '2'; I wanted it to count an entry for the month of August if the employee is "Regular" or "Probationary", and if it was the same category as on the leftmost column.

      My formula is: =SUM(COUNTIF('WORK ACCIDENT LOG'!A:A,(MONTH(8))),(COUNTIF('WORK ACCIDENT LOG'!G:G,{"Regular","Probationary"})),(COUNTIF('WORK ACCIDENT LOG'!I:I,AUGUST!W51)))

      I've been trying Sumproduct, max(sum. Doesn't really help. Would appreciate any advice. Thank you!

  20. I want add "OR" condition between 2 countifs

    countifs($A:$A,">1",$A:$A,"80",$B:$B,"<100")

    How can i acheive this. Please help.

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)