+ Reply to Thread
Results 1 to 6 of 6

Excel IF function shows incorrect result

Hybrid View

johnhotrod Excel IF function shows... 02-27-2014, 05:45 PM
tigeravatar Re: Excel IF function shows... 02-27-2014, 05:59 PM
zookeepertx Re: Excel IF function shows... 02-27-2014, 06:01 PM
johnhotrod Re: Excel IF function shows... 02-27-2014, 06:27 PM
tigeravatar Re: Excel IF function shows... 02-27-2014, 06:43 PM
johnhotrod Re: Excel IF function shows... 02-27-2014, 06:59 PM
  1. #1
    Registered User
    Join Date
    02-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Post Excel IF function shows incorrect result

    I made a sheet which calculates columns of numbers. Cell A1 adds column A and cell B1 ads column B. But to make this explanation as simple as possible, lets just say that column A equals exactly 5 in cell A1 (A1=5), and column B equals exactly 5 in cell B1 (B1=5).

    Somewhere else in the sheet (let's say cell C5) I need to compare the results in cell A1 and B1 and IF they are equal, I need a TRUE result. This is the formula in cell C5: =IF(A1=B1,TRUE,FALSE)

    Given that A1=5 and B1=5, the result in C5 should be TRUE. The problem I'm having is that Excel is returning FALSE when cells A1 and B1 ARE BOTH EQUAL TO EXACTLY 5.

    Example of the SHEET, I hope this helps: (the periods are to keep their places, otherwise when you post the spaces go away)

    ........ A.......B.......C........D
    1.......5........5.......5
    2
    3
    4
    5......................FALSE (FALSE is in cell C5) < the formula in cell C5 is =IF(A1=B1,TRUE,FALSE)
    6

    And if I re-write cell C5 formula (with cell A1 and cell B1 still exactly equal to 5): =IF(A1<>B1,TRUE,FALSE) it returns a TRUE.

    I typed a 5 in A1 and B1 (so they are exactly equal to 5 no decimal spaces) and I'm still getting the incorrect FALSE.

    I am using Excel 2013 on a Windows 8 PC.

    I am at a complete loss. Did I accidentally hit a CONTROL or ALT shortcut KEY that is making Excel return a negative (opposite) result?
    Last edited by johnhotrod; 02-27-2014 at 06:41 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Excel IF function shows incorrect result

    Hello johnhotrod,

    Are the actual values for those cells 5? Or are they just really close, but display as 5? Like 5.000001 and 4.9999999? Alternately, are they a simple decimal that when rounded would equal 5 and you have the cell formatted as number so that it shows the rounded value when they aren't actually 5?

    It's hard to say what's going on without seeing an example containing the issue.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    06-25-2013
    Location
    Longview, TX
    MS-Off Ver
    MS365
    Posts
    338

    Re: Excel IF function shows incorrect result

    Are there any decimal numbers in rows 1-5 that might be getting rounded? Z100 would see that as not being equal, even if the rounded numbers appear to match.

    Jenny

  4. #4
    Registered User
    Join Date
    02-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Excel IF function shows incorrect result

    Thnk you for the reply <Jenny> and <tigeravatar>, but I checked my work and typed a 5 in cells A1 and B1 and still get the FALSE result.

    I re-typed the original thread hoping to clarify more.

    Thanks for the help guys.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Excel IF function shows incorrect result

    I am unable to duplicate this issue
    If you open a new worksheet, is it still giving you the problem on a new sheet?

  6. #6
    Registered User
    Join Date
    02-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Excel IF function shows incorrect result

    Just tried your suggestion and opened a new sheet. Typed a 5 in A1 and 5 in B1 and wrote the formula =IF(A1=B1,TRUE,FALSE) IN C3.

    The result was TRUE which is correct. BAFFLED!!!

    There is obviously something wrong with the problem worksheet.

+ 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. Macro shows incorrect result
    By fsalas2006 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2014, 09:22 PM
  2. [SOLVED] Function Arguments window shows result, cell shows a 0
    By fluffsmckenzie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-09-2013, 05:48 PM
  3. Autosum function Incorrect result
    By tartanswan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-01-2008, 08:38 AM
  4. [SOLVED] IF function returning incorrect result
    By Hillary E. in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2006, 12:43 PM
  5. RSQ function gives incorrect result
    By imurch in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2005, 09:40 AM

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