+ Reply to Thread
Results 1 to 5 of 5

Countif does not work with numbers stored as text

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Countif does not work with numbers stored as text

    I am trying to use below simple Countif but it does not work, I am sure it has something to do with the fact that value in A2 is number stored as text.

    I tried to wrap A2 in Text(A2,0) but did not help. I am sure values in cells are correct because when I compare i.e. A2 with A3 using If formula I get a match but when I do Countif I get meaningless numbers.

    Also when I convert text to numbers my countif works but unfortunately I need to keep the formatting.

    Any help please?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Countif does not work with numbers stored as text

    What value is the countif returning? Is it an error?
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Countif does not work with numbers stored as text

    Maybe try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Countif does not work with numbers stored as text

    Please see below example of data, following numbers are stored as text if you store them as number the last thee digits are changed to 000. This is the reason they are stored as text.

    However when I do Countif, formula sees them as numbers insetad of text that is converts last three digits to 0, so would count them as the same value.


    Using --A1 did not help. I would be grateful for some further suggestions.


    250603365001543285
    250603365001543032
    250603365001543704

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Countif does not work with numbers stored as text

    You'll have to use SUMPRODUCT:

    =SUMPRODUCT(($A$2:$A$46=A2)+0)
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Marco to convert numbers stored as text to numbers and dates stored as text to numbers
    By a2424 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2014, 10:19 AM
  2. [SOLVED] Convert numbers stored as text to numbers for range of data that changes
    By excel2425 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2014, 01:57 PM
  3. [SOLVED] Convert all numbers stored as text or custom formatted to numbers &no decimals - 40 sheets
    By synses in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 01:46 AM
  4. Replies: 8
    Last Post: 01-16-2011, 07:27 PM
  5. Replies: 2
    Last Post: 10-22-2009, 02:50 PM

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