+ Reply to Thread
Results 1 to 7 of 7

COUNTIF inconsistency

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    COUNTIF inconsistency

    I came across a great tip for finding duplicates in long data lists (mrexcel.com/tip138.shtml), but its only working some of the time.

    The formula:

    Please Login or Register  to view this content.
    1. I have long number strings in 5,000 row spreadsheets
    2. I'm trying to find duplicates in numbers that look like this: "014824-00242"
    3. The COUNTIF command will sometimes display accurately, sometimes list everything as "TRUE" regardless of the content. Sometimes it does.

    Screencap:
    \1

    Attempted workarounds:
    • I have pasted into a fresh CSV spreadsheet to try and get any odd formatting out, then saving back into an XLSX file.
    • Also, restarting Excel seem to do the trick, before but it doesn't anymore.

    Does anyone have any idea what could be causing this? Its driving me crazy that it was one moment solving problems and the next ignoring my data.

    Thanks!
    Last edited by webfork; 03-24-2011 at 05:25 PM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: COUNTIF inconsistency

    There is no inconsistency at all here

    First the countif is evaluated and of course returns 0
    Then your formula checks if 0=0 which is TRUE

    Try the formula auditing to see the formula at work

    EDIT : remove the "=0" part, and all will be well

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: COUNTIF inconsistency

    The formula in your picture appears to be checking the value in cell C2, but is in row 3 (at least). You may need to check your cell/row alignment in your formula.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIF inconsistency

    post a workbook not an image, but your image has the wrong formula in, the mr excel tip assumes you have header rows with data starting in c2 ,so g2 would have the formula =COUNTIF(C$1:C1,C2)=0 when dragged down this would increment so g3 would read =COUNTIF(C$1:C2,C3)=0
    and g4 =COUNTIF(C$1:C3,C4)=0
    and so on
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    03-22-2011
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: COUNTIF inconsistency

    Thanks everyone who replied so quick and with so many suggestions. That really helped me out of a jam.

    The field didn't update after I tried some of the fixes suggested, but it is working now and I'm not sure why. I saved a temporary spreadsheet as an XLSX format document (was using XLS by default for compatibility reasons) and that seemed to trigger the refresh in the main doc (which was already saved as XLSX).

    I have switched over to use XLSX by default in settings just to be safe.

    Quote Originally Posted by martindwilson View Post
    post a workbook not an image, but your image has the wrong formula in
    Yeah sorry, that was a pretty little-league mistake.

    UPDATE: Yes, saving triggers a refresh. Resolved. Thanks again.
    Last edited by webfork; 03-22-2011 at 04:44 PM. Reason: (update)

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: COUNTIF inconsistency

    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Registered User
    Join Date
    03-22-2011
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: COUNTIF inconsistency

    > Your post does not comply with Rule 9 of our Forum [/I][URL="http://www.excelforum.com/forum-rules/642590-forum-rules.html"]

    Yes, I was breaking that rule. I had difficulty with this because I clicked the 'open in a new tab' button in Firefox. I thought one of my Firefox plugins was interfering and I didn't have an easy way to disable those at time of posting.

    > If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.

    I thought I did -- saving caused a refresh?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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