+ Reply to Thread
Results 1 to 15 of 15

COUNTIF Formula for Non-Numeric Data Not Working

  1. #1
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Unhappy COUNTIF Formula for Non-Numeric Data Not Working

    Hello everyone I previously used the formula =COUNTIF(C2:C2030,"KSA") to count how many fields were KSA related for example.

    However, I am trying to use this formula now and every time I try it the formula just returns 0.

    Can anyone assist?

    Thanks in advance for your help.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    That formula would return 0 if thare are no cells in C2:C2030 that = "KSA"

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    ..However, I am trying to use this formula now and every time I try it the formula just returns 0.
    What do you mean? How do you use the formula?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    Quote Originally Posted by Jonmo1 View Post
    That formula would return 0 if thare are no cells in C2:C2030 that = "KSA"
    The particular sheet I am working on has 5060 rows of this number 2309 are KSA. The formula does not return a value of 2309 it returns a value of 0.

    Quote Originally Posted by Fotis1991 View Post
    What do you mean? How do you use the formula?
    The very same formula I typed I have tried using to no avail.

    Also I am trying to return the smallest value in other related spreadsheets but it seems the min function will not work in a sheet with many fields. I tried using the formula to find the smallest value in a column with over 2000 fields and it keeps returning -1 and this is not correct.

    I also tried using gnumeric and libre office and keep getting the same incorrect results.

    Ahhhhhhgggghhh

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    I think you should post a sample book that is giving the incorrect results.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    If you try to increase the range?

    Let's say....

    =COUNTIF(C2:C10000,"KSA")

  7. #7
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    Hey everyone I have uploaded the spreadsheet showing the issue.

    If you look in cell G5062 and see the COUNTIF formula which returns 0 although the correct result should be a figure over 115.

    The Countif formula of =COUNTIF(G2:G50,"KSA") just isn't working and I am totally baffled.

    Thanks in advance for your help in figuring out why it isnt working.

    EDIT: I have figured it out, put an asterick before the last quotation mark.

    Thanks again for all your replies, it was good to know people were trying to help.
    Attached Files Attached Files
    Last edited by Mezzi; 06-10-2013 at 11:05 AM.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    You have trailing spaces in all the cells in column A
    So A1901 DOES NOT = "PORTLAND"
    It actually = "PORTLAND____"

    the _ represent spaces, forum software removes extra spaces..

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    You have so many spaces in column A.

    One way could be this one.

    =COUNTIF(A1901:A2016,"*Portland*")

  10. #10
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    I did not realize that there were replies before I did the edit.

    I also did not know there were spaces after the names. This spreadsheet was created from specialized software and I did not do the abstraction. Thanks for teaching me something new since I had no idea spacing could affect the formula.

    I had found out about the asterick by picking up the book Microsoft Office Excel 2007 Formulas and Functions for Dummies. I use the asterick like this =COUNTIF(G2:G50, "KSA*") Fotis I will use your way just in case there happens to be spaces at the front as well of any words as well.

    Thanks again to you all.

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    ..................

  12. #12
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    Hey guys me again using another COUNTIF to determine the number of new applications made daily the formula is
    =COUNTIF(D2:D8614,"2-Jan-12") my only problem is that when I drag this formula down trying to get the daily results for the entire year the dates are changing to "2-Jan-12" "3-Jan-12" and so on. Unfortunately, what is changing is the cell range which needs to remain constant.

    How can I have the dates change by day without having to manually change the date in 365 rows. Also how can I have the cell range remain constant.

    Thanks in advance and sorry for the bother.
    Last edited by Mezzi; 06-10-2013 at 03:11 PM.

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    List your dates in an adjacent column, e.g. in G2 put the first date and copy it down the column, it will increase by 1 day each time - then use this formula in H2 also copied down

    =COUNTIF(D:D,G2)
    Audere est facere

  14. #14
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,290

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    =COUNTIF($B$2:$B$8614;40908+ROW())

    40909 stands for 1-1-2012
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  15. #15
    Registered User
    Join Date
    04-12-2007
    Posts
    8

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    Quote Originally Posted by daddylonglegs View Post
    List your dates in an adjacent column, e.g. in G2 put the first date and copy it down the column, it will increase by 1 day each time - then use this formula in H2 also copied down

    =COUNTIF(D:D,G2)
    Daddylonglegs you are the best, thanks so much

    Quote Originally Posted by popipipo View Post
    =COUNTIF($B$2:$B$8614;40908+ROW())

    40909 stands for 1-1-2012
    Popipipo thanks for your reply, unfortunately this didn't work for me but I thank you nonetheless

    You guys are the best.

  16. #16
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,290

    Re: COUNTIF Formula for Non-Numeric Data Not Working

    unfortunately this didn't work for me
    Why not
    See this example

    Or did I misunderstood you
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1