Comments on: Google Spreadsheet COUNTIF function with formula examples

We continue exploring the possibilities of Google Spreadsheets with COUNTIF function. Learn why you may need it and how it can be applied to your daily work with the tables. Continue reading

Comments page 7. Total comments: 393

  1. Hello,

    I used the formula =COUNTIF(M3, "*(Pme)*" to tally the number of times that a specific cell contains a coding tag. However, the formula is treating 0/1 as No/Yes instead of giving me a total. Can I adjust the formula to count the number of times the coding tag appears instead?

    For example, I have cell M3 which contains the sentence "Also, I (S) know (Pme) plenty of straight guys (Ph) who (S) are attracted (Pme) to more masculine women (Ph)". The formula above produced the number 1, but I want it to produce the number 2 because the tag (Pme) appears twice in this sentence.

    Any feedback would be appreciated. Thank you!

    1. Sorry, I forgot to close the parentheses. The formula is: =COUNTIF(M3, "*(Pme)*").

      1. Okay, so upon further searching, I found =COUNTA and =COUNTUNIQUE, which yielded the results I wanted, but now I'm wondering the difference between the two. Thank you!

        1. I take the previous comment back-- these functions did not necessarily fix the issue. Sorry for the multiple posts and thank you for your time!

          1. Hello Sarah,

            none of the functions you mentioned will help: they count cells that contain the word you need, not the number of words within those cells. For your task, you need to use the LEN function like this:
            =(LEN(M3)-LEN(SUBSTITUTE(M3,"(Pme)","")))/LEN("(Pme)")

            1. LEN(M3) - counts the number of all chars in a cell
            2. LEN(SUBSTITUTE(M3,"(Pme)","")) - counts the number of chars without the entry of interest
            3. then subtract one from another to find the difference in chars
            4. and lastly, divide it by the total number of chars
            1. That fixed my spreadsheet, thank you so much for your help!

  2. Hello,
    I'm trying to find a way to use countifs based on values being split out of comma separated values, but something isn't quite clicking.
    If i have:
    ID
    1
    2
    3
    and then
    SCORE | SELECTION
    0 | 1,3
    1 | 2,3

    and i want to find out the total number of times that ID 3 was selected and there was a score of 0. The result should be 1.
    I feel like i'm close with
    =COUNTIFS(SPLIT($G$11:$G$14,","),3,$F$11:$F$14,0)
    But i get told "Array arguments to COUNTIFS are of different size."

    1. Hello Dan,

      The SPLIT function won't work like this. It's supposed to separate values to multiple cells rather than extract records needed for calculations. Our tech specialist has created the following array formula that should help:
      =ArrayFormula(SUM((MID($G$12:$G$13,FIND(",",$G$12:$G$13)+1,1)="3")*(LEFT($G$12:$G$13, 1)="0")))

  3. Hello,
    i use Google Sheet and i would like to calculate how many cells there are in a column of the same color, provided there is a value from another colone. COUNTIF is not good for color

    example:
    (A2: A100; A15; B2: B11; "Acquired")

    Thanks for your help. =)

      1. OK, thanks.
        but that's not exactly what I'm trying to do.
        This is not a COUNTIF but rather a COUNTIFS that I would need.

        this example may be better explained.

        A B C D
        1 | color 1 | Acquired | Total color 1 Acquired | 2 |
        2 | color 1 | Blocked | Total color 2 Acquired | 1 |
        3 | color 2 | Blocked | Total color 1 Bloqued | 1 |
        4 | color 2 | Acquired | Total color 2 Bloqued | 1 |
        5 | color 1 | Acquired |

        1. Tony,

          Since there's no standard way of counting cells by their colours, our tool will still be useful.
          If I understand your task correctly and "color 1" and "color 2" are cells with backgrounds, you can generate a formula with our Function by colour tool and then use it in your COUNTIFS, like this:
          =COUNTIFS(A2:A6,valuesByColor("#d9ead3","#000000",Sheet10!A2:A6),B2:B6,"Acquired")

          The part in bold was generated by our add-on.
          The entire formula counts all cells in column B with a word Acquired if a cell in column A is coloured in accordance with a pattern in valuesByColor.

          1. OK, thanks.
            But I still have a little problem.
            I think there is a problem with the third parameter of valueByColor "srcRange", it returns 1 whereas it should send me back 9.
            I think that once he has found a good result, he does not continue the loop in the range.

            sorry for the double post -_-"

            1. I tried the method "valueByColor" without going through a COUNTIFS, and I realized that it sends me the values ​​in the cells, but what I want to do is count the number of cells of the same color provided that the cell is acquired (color in colone A, and acquired in colone B).

              1. ok, I just sent you the file with a copy of our conversation.

                Thanks.

              2. Tony,

                It's rather difficult to tell why your formula doesn't work. Could you please share your spreadsheets with us to have a look? It's support@4-bits.com. We don't monitor its Inbox, so please confirm by replying here once you share the file. Thank you.

  4. Hello -
    I used your tip to figure out how to count non blank cells in a column on a certain sheet tab (Tab1). This formula works for that: =COUNTIF('Tab1'!Y2:Y889, "")
    I wish to further filter the count by a text value in another column. I want to count the non blank cells in column Y that have the value "A" in column N. Then count the non blank cells in column Y that have the value "B" in column N. This formula doesn't work - I am not sure how to connect them. =COUNTIF('Tab1'!Y2:Y889, "") AND COUNTIF('Tab1'!N1:N930,"A") Thank you so much.

    1. Note the characters between the double quotes in the formulas above are these - not sure why they did not display. If they don't display again in this comment, they are the less than sign and the greater than sign. Thank you again.

      1. Hello Casey,

        You need to use COUNTIFS for the task:
        =COUNTIFS(Tab1!Y2:Y889,"<>",Tab1!N2:N889,"A")

        Please keep in mind that the function requires ranges of the same sizes. Based on your example, you'll have to enter either rows 2:889 for both columns or 1:930.

        1. Thank you, Natalia - I thought I might need to use IFS, but I had the syntax garbled. Thank you so much - this worked exactly as I wanted.

  5. We want to count the values between certain dates (for our monthly report).
    Our document is structured like this:
    A column: Date (eg. 01-01-2019)
    B column: Value (eg. Owned, earned or paid)
    What's the correct formula to count the number of Owned between 01-01-2019 and 31-01-2019? Any help would be greatly appreciated!

    1. Levi,

      Please try this formula:
      =COUNTIFS(B2:B10,"Owned",A2:A10,">="&DATE(2019,1,1),A2:A10,"<="&DATE(2019,1,31))

  6. I have 4 tabs of information with columns of information that are in drop-down lists. I need to calculate the total number of times each of the items in the drop-down lists is selected (on a 5th tab). I've created the 5th tab and done the "COUNTIF" but it's not totaling. Instead, there's an error.

    1. To clarify, this is on a Google Sheet.

      1. Bill,

        will you be able to share your file with us at support@4-bits.com? If so, please reply here once it's shared. We'll look at how your data is stored exactly and try to come up with a solution.
        Thank you.

  7. Hi,

    Can you help me in getting a formula for a countif with cells containing duplicate texts.
    Example:

    R1 test
    R2 test | test

    when i use this; =countif(A:A,"*test*"), i only get 2; but I want to get 3 as the result.

    Thanks for the help.

    1. Hi Ralph,

      If your duplicates are divided by the same "|" character, you can try this formula:
      =COUNTIF(ArrayFormula(SPLIT(JOIN(" | ",A:A)," | ")),"test")

      Otherwise, you can use our Split tool to divide cells with duplicates by their delimiters and then count all occurrences.

  8. I want to know the total value of column b if column f is John column h is July

  9. What if I need a pie chart to show payment

    If Chocolate Milk, Count the Total Value of all the orders.

    I have a data set where the 'Chocolate Milk' has different values, but I need the formula to calculate all the column A results if 'Cholocate Milk', and take the value from another Column. :-/

    1. Hello Jane,

      To find out the total only for those cells that contain "Chocolate Milk", you need to use the SUMIF function instead. You'll find the tutorial about it on this page.

  10. Dear Sir ,
    I am having a set of data having some duplicate values in it . I wants to mark its frequency in its adjacent column except first one .
    like
    1
    1 duplicate
    1 duplicate
    2
    3
    2 duplicate
    4
    5
    2 duplicate

    1. Hello Abhinav,

      I'm sorry, I'm afraid there's no easy formula to do that.

      You can either identify duplicates without the 1st occurrences using a formula like this:
      =IF(COUNTIF($A$2:$A2, $A2)>1, "Duplicate", "")

      or count duplicates by the example of this article for Excel.

  11. Hi,

    I'm trying to use a cell as the criterion for a countif search, but I can't make it work.

    Name Running Count
    Joe Smith (=countif(List1!F:F,"*Smith, Joe*")

    What I would like to do is be able to have sheets use a cell, so then I could copy the same formula all the way down. Something like =countif(List1!F:F,[text from cell a2]).

    Is this possible?

    1. Also, I forgot to say that the text from A2 that I will be searching for will be in a cell with other names as well, so I need a wildcard to be able to search withing the cells of names to find the one I want.

      So, the cell I'm searching might say "Peterson, John, Johnson, Mike, Thompson, Charles, Smith, Joe, Williams, Sam"

      From that I need to be able to search for the name I want, which would be found in cell A2.

      I hope that makes sense.

      1. Hi Jeff,

        If you have "Joe Smith" written in A2, but the range to search in contains names like "Smith, Joe", referring to A2 won't give you the correct result. The formula will look for the exact contents of A2.

        In order to use A2 as a source cell, you need to extract first and last names and concatenate them separating with a comma. Here's what I can offer to try:

        =COUNTIF(List1!F:F,"*"&CONCATENATE(RIGHT(A2,LEN(A2)-SEARCH(" ",A2)),", ",LEFT(A2, SEARCH(" ",A2)-1))&"*")

  12. Hi, I am trying to find the count of TRUE Values and False Values. My data set is from B2:K146. When I do =COUNTIF(B1:K146,"TRUE")I get an incorrect number. When try the same formual with False, I get a HUGE number that isn't even the amount of cells I have filled with either True or False. Any help is appreciated, I have a huge data set full of True/False that I have to parse out and being able to use a formula to figure out how many are true vs false will be a lifesaver!!!!1

    1. Hi Nickole,

      You can try omitting double quotes in your formula since TRUE and FALSE are Booleans that doesn't necessarily require these:
      =COUNTIF(B2:K146,TRUE)

      Also, make sure to apply the correct data format to your resulting cell: Format > Number > Number.

  13. Hi, I have 3 columns
    Column C = Category
    Column D = boolean

    I have many cateogies
    I need to count the amount of rows that has a specific category with TRUE in the column D.
    I would need something like this: =countif(C:C, and("C=category1",D=true))

    Can you help me? THANKS!
    example: count how many CGAs has true should give: 2
    C__|D__
    CGA|true
    VGA|true
    CGA|false
    VGA|false
    CGA|true

    THANKS!!!

  14. Hello!
    I've tried to do COUNTIF for multiple variables, but it's not pulling the correct data.
    How do I set up the formula so that both variables in a row are true.
    Example data:
    Bob, Male, Form 1
    George, Male, Form 2
    Sally, Female, Form 1
    Jo, Female, Form 1
    Sue, Male, Form 1
    Jane, Female, Form 1
    I would want formula to output the numbers that correspond to gender:
    Form 1 - 2 Male
    Form 1 - 3 Female
    Form 2 - 1 Male

    1. Hi Melissa,

      I'm sorry, I don't quite understand your task. If you could create a sample spreadsheet with your source data and the result you'd like to get and share it to support@4-bits.com, I may be able to come up with a solution.
      Once you share the file, please let me know by replying here.

  15. how to filter data or counts the value if a cell contain more than one value which is seperated by commas

  16. You are a life saver, I feel into the trap of =COUNTIF(C6:C16, D6:D16,"Milk Chocolate") and this ironed that out.

  17. Is it possible to do a countif of cells based on criteria of a previous cell? For example, I would like to count the number of cells in a row with the number 26, but only if the previous cell in the row is the number 25.

  18. Hi! Is there a way to exclude qualifications? I have a column with multiple sources listed in each cell "Referral, Job Site, Agency, LinkedIn" and I'd like to only count the ones with the word "LinkedIn" in the cell AND the ones where LinkedIn appears in a cell with other sources too - but as separate counts.

  19. Thanks for the article! I have this range where returns values from another range of data based on criteria, I put iferror to return "" where there's no valid data, then I want to count the cells with valid data returned with =COUNTIF(E3:AI3,"""") but it keeps counting the whole range with "" as well. Can you help me? Thank you!

    1. Hi Tramy,

      I'm sorry I'm afraid I don't really understand the task. You said IFERROR returns "" for invalid data. But then you are trying to count valid data and indicate it as "" as well.
      Could you please describe the task in more detail and give the examples of valid/invalid data?

  20. I am doing a volunteer gig and they are pushing my limits of programming but I am learning so much. I need some help. I have two sheets.
    Rating Data: Forces a unique client ID number in column A which is also named range "PTSD_ClientID".
    L1 Data: column A, or named range "L1_ClientID" forces validation to enter a value found in column A of Rating Data. It does not enforce unique values.

    Here's what I would love some help with. I have a column I in the Rating Data sheet that I would like to display of the count of all entries for that row's client ID (also named range PTSD_ClientID" that is entered in L1 Data.

    Any recommendations or tutorials to send me to on how I might achieve this. Thanks in advance!

    1. Hi Erika,

      If I understand your task correctly, you need to use the formula like this on the Rating Data sheet:
      =COUNTIF(Sheet2!A:A,$A1)

      where Sheet2 is your L1 Data, A:A is column A on the L1 Data sheet, and A1 is a cell with the unique ID on Rating Data.

  21. Hello, can you help me with a Google sheet formula to count how many days a student attended tutoring, where:
    A1 Last Name
    B1 First Name
    C1 Date (of the week the student attended tutoring from Tuesday to Friday)

    The data contains 100 students where some attended 1 day, some 2+, some 3+, etc.

    Thank you very much.

    1. Hello Alejandra,
      If I get it right, you need to add up numbers entered next to the student names. For that, you need to use SUMIF rather than COUNTIF. We have an article about it as well, you'll find it here.

  22. How do I count if for a range of multiple text entries. I.e.

    Cell A2 contains the text "dog"

    Cell A3 contains "dog, cat, cow, chicken"

    I want to perform a count if A3 contains A2 in the string of text.

  23. How do I create a formula that counts if one cell is greater than another?

  24. I think the post needs to be looked over for typos. I got lost in the very beginning. The post is below. And these are my questions.

    Do we count the sales in the West region, not Milk Chocolate?

    Why do I put the cursor in C3, which in the middle of the data of the first picture and contains "West" and try to enter the COUNTIF function there?
    Where is the range D4:B74 coming from?

    "Let's begin from the basics.

    We need to count the number of sales in the "West" region. Place the cursor in C3 and enter the equality sign (=). Google Sheet immediately understands that we are going to enter a formula. As soon as you type the letter "C", it will prompt us to choose a function that begins with this letter. And we select "COUNTIF".

    The first argument of COUNTIF is represented by the following range: D4:B74. By the way, you don't have to enter the range manually - mouse selection is enough. Then enter a comma (,) and specify the second argument - searching criteria.

    The second argument is a value that we're going to look for across the selected range. In our case it's going to be the text - "Milk Chocolate". Remember to finish the function with a closing bracket ")" and press "Enter".
    "

    1. Thank you very much for your attention to detail, Mate!
      We changed a few screenshots, but somehow totally forgot to adjust the text, so sorry about that!
      Fixed! :)

  25. Hi there,

    I've got a COUNTIFS formula which I'm building to try and accommodate variable criteria, i.e. dates.

    I want to code a COUNTIF with 'greater than or equal to' to a date cell, but it doesn't seem to want to read that cell. I've tried formatting the date cell in different ways but not working.

    For simplicity I've reduced it to a COUNTIF.

    None of the following work:
    =COUNTIF('Student Tracking Report'!AS:AS,<=D$5)
    =COUNTIF('Student Tracking Report'!AS:AS,"<="D$5)
    =COUNTIF('Student Tracking Report'!AS:AS,"<=D$5")

    This does work, but won't be variable:
    =COUNTIF('Student Tracking Report'!AS:AS,"<=43344")

    Thanks for your help.

    Marcus

    1. Hi
      The solution is pretty easy, you've just missed the "&" symbol before the cell address. Try the formula below and enjoy ;) =COUNTIF('Student Tracking Report'!AS:AS,"<="&D$5)

      BTW, it is in this article in the "COUNTIF Google Sheets for less than, greater than or equal to" part.

  26. Any know how to COUNTIF from anothes sheet page into the same file?
    Thanks.

    1. Create the formula on one sheet, but refer to cells from another sheet :)
      It will look like this: =COUNTIF(Sheet1!A1:A10,">20")

  27. Hi,

    Could you help me with the following problem:

    I want to count the cells in a range (column) which contains any characters inside. Cells has time format, and an 'if' formula: =IF(OR(B10="",D10=""),"",D10-B10-$M$4)

    I tried with countif(range, "*") -> it interestingly count cells which are empty, contains just the formula, but no value, as the corresponding Bx or Dx was empty. And does not count any which has a value (8:00 for e.g.) out of the formula.

    With countif(range, "") I had exactly the same result...

    Am I doing something wrong?
    Please help!

  28. Inx:
    Where Fruit is in F2:F5 and Color is in G2:G5 the formula looks like this in an empty cell:
    =COUNTIFS(F2:F5,"Apples",G2:G5,"Blue")

  29. Hello,
    Could you help me with a formula for the following:
    I need a count of the number of people who answered one answer in the first column, who also answered a specific answer in the second column.
    Example:
    People who choose "Apples" as 'favourite fruit' who ALSO choose "Blue" as 'favourite colour'.

    Thank you

  30. I have results from a google form.

    In the form responses, I need to separate the data in several ways.

    1. Responses/multiple choice answers by Class/Teacher(which is a column/question in the Form) and by the entire school.

    2. Each response has been assigned a letter value which is an abbreviation for a response type. (I've already used Find & Replace to change the text answers to the letter value, now I just need to get and graph the counts of each of the response types.)

    3. Responses by student.

    There has got to be a way to separate into three additional spreadsheets using the information from the initial form response spreadsheet.

  31. What if I need to match a text with case sensitivity? Looks impossible with this formula, but probably shouldn't be.

  32. I have a column of dates (B3:B2) and I wanted to get a count for the following criteria:

    Under 2 years
    2-5 Years
    6-10 Years
    Over 10 years

    I have used this for the under 2 years and it is not returning the proper number:

    =countif(B5:B53,"<today()-730")

    1. I know this is very old, but it might help someone else.

      I was trying to build a very similar formula, and I also was not having any luck. However, I found someone else mention that you can 'combine' formulas by using the & sign, so I tried this and it worked.

      =countif(B5:B53,"<" & today()-730)

      Apparently the today() function shouldn't be in quotes.

  33. Hi,

    I'm looking for a formula for 4 different countries (Ireland, Denmark, UK & Sweden) so I can keep track of my days in a country throughout the year. I'm using the below,

    =COUNTIF(W3:W30,"Ireland")+COUNTIF(W3:W30,"Denmark")+COUNTIF(W3:W30,"UK")+COUNTIF(W3:W30,"Sweden")

    I've tried using *UK* etc but not working. I have this formula in another column and it works fine?? Help :)

  34. Hello

    I need some help in writing a query/script for excel/googlehseets that will take a word and link/URL from where I want to find the word then the query/script will count the number of repeating time of given word and place that number back into excel/googlesheets.
    Anybody can help me in this.

    Thanks in advance.

  35. So I have a sheet where I want to track how many participants answer certain questions. There are 11 questions and each question has its own reference cell. The cell beside the participant will have something like 1,2,3,7,9 in it, but I can't figure out how to count only one of those numbers while excluding the rest. Any suggestions?

    1. Just to clarify: are the respondents in the first column, the response to the secomd question in the secomd column, and so on for each of the eleven questions?

      1. A coworker of mine helped me figure it out: =COUNTIF(B$2:B$30, "*"&I2&"*")
        Putting the cell that contained the number I was trying to find in between "&"'s and putting the wildcards in ""'s joins it to whatever before and whatever after. This is SO INCREDIBLY helpful! posting it here for all to see :-) this means you can have multiple variables in the same cell and still be able to parse that data!

      2. (oh man...I just looked at how my reply was formatted...it looks awful. Can you follow it at all?)

      3. So, the columns and stuff would look like this

        NAME QUESTIONS ASKED QUESTION # of PARTICIPANTS
        Joe D 1,2,3,7,9 7 [insert formula here]

        (Does that layout make sense?)

  36. Hello,

    could anyone help me with the following task? My dataset contains (among other) these columns: (A)Date of the 1st check, (B)date of the 2nd check, (C)Date of the 3rd check and (D)Status. Let's say Status could be "Waiting", "Not OK", "OK". At the end of the day I need a number of cases, where Status="OK" and at least one of the Checks (1st, 2nd, OR 3rd) were done today. If there were just one check, I would use: countifs(D:D;"OK";A:A;"26.02.2018"). But I am not sure how to solve out the task, where one of the required criterion (today's date) can be met in one of the several columns.

    Thanks a lot

    1. Greetings, Ondra!
      Simply modify the single-column version of your formula to include the other columns.
      =countifs(D:D;"OK"; A:C;"26.02.2018")

      To make the formula a bit more versatile, you can replace the hard-coded date with, for example, the TODAY() function or a cell reference that contains a date.
      =countifs(D:D;"OK"; A:C;today())
      =countifs(D:D;"OK"; A:C;E2)

      To be really cool, you could use something like the last formula, then find items checked today by entering
      =today()
      in cell E2. :-)

  37. Just wanted to say thank you. This was the clearest depiction of how to reference other cells within a COUNTIFS formula that I could find.

  38. HOW TO COUNT HOW MANY CUSTOMER ORDER MILK, DARK ETC. THANKS

  39. Hey,
    could you give me a hint how to use countifs with the following table which contains results of different soccer games;

    as an example
    A1:A5 Name Player 1
    B1:B5 Goals Player 1
    C1:C5 Goals Player 2
    D1:D5 Name Player 2

    Now, I wanna count the wins (more goals) of a specific player:
    =countifs(A1:A5, "Player1", B1:C5, (B1:B5 > C1:C5))

    Unfortunately, the second part throws an error :(

    1. Hey, Martin,

      if I understand your task correctly, please try the following formula:
      =SUMPRODUCT((A1:A5="Player 1"),(B1:B5>C1:C5)

      If it doesn't work, please go to File > Spreadsheet settings > Calculations, and make sure that Iterative calculation option is On.

      Hope this helps!

  40. Is there a way to use =countif to count if there is any value in the identified cell/cells? For example:
    | | -should not count
    |a | -should count
    | | -should not count
    |ab| -should count

  41. Hello!

    Is it possible to use COUNTIF to determine how many cells do not contain a particular letter? I understand how to use the formula when dealing with numbers, but mathematical symbols don't seem to work the same way with letters.

    So, for example, if I want to know how many cells in A1:A25 do NOT contain G, how would I write that?

    Thank you!

    1. Hello,

      Please try the following formula:
      =ArrayFormula(SUM(IFERROR(FIND("G",A1:A25)=0,1)*1))

      Hope it will help you.

      1. Gennady,
        You had no formula in your response.
        I have the same obvious issue as Rachel. I want to count cells which are not "N".
        Thanks,
        Brad

        1. Brad,

          For some reason, Gennady's formula wasn't displayed. I've edited the comment and now you can see the formula. Please try to adjust it for your data.

  42. in google sheets, i'm trying to count the number of occurrences where column W=YES, IF column P=5. How can I write this formula?

  43. Is it possible to use, as a criterion, the background color of a cell in the countif function? For example, in column A (say from A5 to A10), there are two types of cells: those that have a green background color and those that are white. The range of cells to be added is in column B (say B5 to B10). I would like, in cell B11, to sum cells B5 to B10 if they are next to green cells. In cell B12, I would like to do the same for the cells next to the white cells.
    I thought using Apps script, but I would prefer to use simple formulas.
    Thank you.

    1. [resolved]Finally, I decided not to use the background color as a criterion for selecting the cells to be added. I found a simpler solution, based on the content of the cells using the sumif function. Specifically, I used the following formula in cell C268:
      SUMIF ($A5: $A267; "* (AFR)"; C5: C267)
      In other words, instead of using the color, I select the cells whose content ends with the 5 characters: (AFR)
      Merci

  44. What is the countif formula in goggle sheets if the possible choices included are as follows: >, <, or =. I have used the following formula and keep getting an answer of 0 students with the correct answer. However hundreds of students have the correct answer.
    =countif(BL3,"<")

    1. Hello, Mary,

      If I understand your task correctly, there's something missing from your formula. You need to count if one value is greater/less than or equals to some other value. Also, please make sure to indicate the range of cells correctly in the first argument.

      So, if your data is spread across B1:L3 and you need to count all the values that are less than 3, your formula should look like this:
      =COUNTIF(B1:L3,"<3")

      Please adjust your formula according to your data, and it should work :)

  45. I'm trying to search for the number of occurrences on a particular date. The info in the cell is the data and time stamp. How would I set up the formula so it is only pulling the date?

    1. Hello, Lisa,

      supposing, that the date an time are in A1, use the following formula in the cell where you want to return the date, A2 for example:
      =DATEVALUE(A1)

      Then select A2, and in the menu choose Format > Number > Date. You will see only the date from A1 in this cell.

      Hope this is what you need!

  46. what is the formula for.

    if a1 is less than b1, put good
    if a1 is greater than or equal to b1, put bad
    if a1 is less than b1 but greater than c1, put critical

    put this in one formula?

    1. Hi, Loise,

      try this formula:
      =IF(and(A1<B1,A1<=C1), "good", IF(AND(A1>B1,A1=B1), "bad", IF(AND(A1<B1,A1>C1), "critical","")))

      You can read more about IF function in Google Sheets in this article.

      Hope this helps!

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 :)