+ Reply to Thread
Results 1 to 6 of 6

IF with Decimals

  1. #1
    Registered User
    Join Date
    08-13-2017
    Location
    Muscat
    MS-Off Ver
    MS Professional Plus 2013
    Posts
    2

    IF with Decimals

    Hello, I have two values in two different columns (Col A and B) with a third (Col C) being the difference between A and B.

    I have a formula in Col D as "=if (A1-B1=0.01125,"NC","C")". Even if the difference in value between A and B is equal to 0.01125, it gives the result value as "C".

    Regards

    RK

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider (Windows 11 64-bit)
    Posts
    53,243

    Re: IF with Decimals

    Try this:

    =IF(ROUND(A1-B1,5)=0.01125,"NC","C")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    08-13-2017
    Location
    Muscat
    MS-Off Ver
    MS Professional Plus 2013
    Posts
    2

    Re: IF with Decimals

    Thanks. Its solved.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    20,718

    Re: IF with Decimals

    Display values A1 and B1 with 10 decimal places: you will probably find the difference is not exactly 0.01125.

    You will need to apply a ROUND function to A1 and B1

    =IF(ROUND(A1,5)-ROUND(B1,5)=0.01125,"NC","C")

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider (Windows 11 64-bit)
    Posts
    53,243

    Re: IF with Decimals

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: IF with Decimals

    [.... deleted by me; duplicate ....]
    Last edited by joeu2004; 08-13-2017 at 03:12 AM.

+ 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. Rounding 2 decimals to specific 2 decimals
    By danyel191 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2016, 01:41 PM
  2. Replies: 2
    Last Post: 02-13-2015, 07:36 AM
  3. How to add more than 15 decimals
    By MMTZ2212 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2013, 02:36 PM
  4. Decimals
    By Shradharani in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-11-2013, 12:22 PM
  5. zero before decimals
    By Masque in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-30-2010, 07:33 AM
  6. Decimals
    By Dohko in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2007, 11:53 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