+ Reply to Thread
Results 1 to 6 of 6

Countif not giving correct number

Hybrid View

  1. #1
    Registered User
    Join Date
    01-05-2009
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    9

    Countif not giving correct number

    Hi,

    I have column T with the below mentioned values

    T5 224362161121934567688261099708
    T6 224362161121934568290661099708
    T7 224362061155685267688261099753
    T8 44218081233978867376660032621
    T9 44218081233978867666360032621

    my formula is like this

    =IF(COUNTIF(T:T,T5)>1,"Duplicate","")

    here eventhough T5 and T6 are not same, I am getting a value Duplicate...

    Please help

  2. #2
    Registered User
    Join Date
    12-08-2008
    Location
    NYC
    MS-Off Ver
    2003 & XP
    Posts
    43
    That should fix it

    =IF(COUNTIF(T:T,">1"&T5),"Duplicate","")

  3. #3
    Registered User
    Join Date
    12-30-2008
    Location
    Vermont, USA
    MS-Off Ver
    Excel 2003
    Posts
    64
    I tried this and it doesn't resolve to "duplicate" for T5. You might want to check for some simple mistake.

    If nothing else, do some error checking by replacing your formula with this:

    =IF(COUNTIF(T:T,T5)>1,"cells "&ADDRESS(ROW(),COLUMN(T$1),4)& " and "&ADDRESS(MATCH(T5,T6:T$10000,0)+ROW(),COLUMN(T$1),4)&" are the same","")

    See what that tells you; if it finds a match of a cell somewhere else in column T, it will give you a message like "cells T5 and T10 are the same". Then check to see whether this is actually true....

    EDIT:

    Nevermind-- the problem you're having is that Excel can only handle 15 digit precision, so it is in fact evaluating T5 and T6 as the same value. You would need to convert your numbers to text strings in order for COUNTIF to distinguish one from the other, I believe. Frustrating!

    Do this instead:

    =IF(ISNA(MATCH(T5,T6:T$10000,0)),"","duplicate at cell "&ADDRESS(MATCH(T5,T6:T$10000,0)+ROW(),COLUMN(T$1),4))
    Last edited by clownfish; 01-05-2009 at 01:30 PM.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    COUNTIF and numeric text

    COUNTIF seems to convert numeric text to numbers. Consequently, if there
    are more than 15 significant digits, Excel rounds off the excess.

    Try something like this:

    =IF(SUMPRODUCT(--($T$2:$T$30=T5))>1,"Duplicate","")
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    01-05-2009
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    9
    Hi Ron,

    I'm getting #NUM! error when I Entered this formula

    =IF(SUMPRODUCT(--(T:T=T5))>1,"Duplicate","")

    Regards,

    Anil

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    You cannot use ranges like T:T with sumproduct
    Use something like T1:T65535

+ 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