+ Reply to Thread
Results 1 to 5 of 5

help with IF function returning a false result instead of a true result

  1. #1
    Registered User
    Join Date
    06-21-2021
    Location
    england
    MS-Off Ver
    2016
    Posts
    10

    help with IF function returning a false result instead of a true result

    basically i want the function to return a TRUE value result instead of a false one based on these numbers

    the formula i want to calculate is:

    price * quantity - actual price = discount price

    as you can see in the file i uploaded a one line example that the formula is true but it gives a false statement.

    thank you for your help
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: help with IF function returning a false result instead of a true result

    If you increase the number of decimals in cell F2, you will see that the calculation actually results in 0.699999 etc. As your Discount column (D) is only 1 decimal place, you can use ROUND in your formula to get it to show correctly, i.e.:

    =IF(ROUND(A2*B2-C2,1)=D2,"yes","no")

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-21-2021
    Location
    england
    MS-Off Ver
    2016
    Posts
    10

    Re: help with IF function returning a false result instead of a true result

    yeah it solved my problem
    thank you very much
    but i don't understand i wrote the numbers down (not copy pasted) so why 14-13.3=0.699999999?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: help with IF function returning a false result instead of a true result

    It is because the number 13.3 cannot be expressed with complete accuracy using binary numbers, which most computers use. Although some (decimal) fractions can be translated completely into binary, some other common fractions cannot - for example 0.1 (or 1/10) will be a recurring fraction in binary, as will 0.3 (or 3/10), in the same way as 1/3 cannot be expressed completely in the decimal numbering system, no matter how many digits are used. Thus you might say that 1/3 is 0.3333 in decimal, but you will find that 0.3333 + 0.3333 + 0.3333 does not equal 1. The same thing is happening here with your numbers.

    Hope this helps.

    Pete

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: help with IF function returning a false result instead of a true result

    Glad to help - thanks for the rep.

    Pete

+ 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] IF, AND, OR Function:True is equation with neg result, False is equation with pos result
    By MrSurveyor in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-06-2021, 07:18 PM
  2. [SOLVED] If the IF function result is false then check the next cell until get a true result
    By Beag air Bheag in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-10-2017, 08:55 AM
  3. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  4. Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 09:05 AM
  5. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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