+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : '=if' statement - matching 2 cells to a decimal place

  1. #1
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    '=if' statement - matching 2 cells to a decimal place

    So far I have the following:

    =if((A1=B1),"OK","ERROR") - if cell A1 and B1 match, it shows "OK", if not, it shows "ERROR"

    This is basing the numbers on monetary values, so all cells are formated in 'accounting'.

    The formula itself works fine, but if:

    A1 contains 20.000002
    B1 contains 20.000003

    Then both round up to £20.00, but as they are both not completely identical, it shows "ERROR"



    How can I amend the formula to only look up to the 2nd decimal place, and no further?

    Thanks
    Last edited by dancing-shadow; 02-04-2011 at 09:33 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: '=if' statement - matching 2 cells to a decimal place

    Try

    =if((ROUND(A1,2)=ROUND(B1,2)),"OK","ERROR")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Re: '=if' statement - matching 2 cells to a decimal place

    Quote Originally Posted by NBVC View Post
    Try

    =if((ROUND(A1,2)=ROUND(B1,2)),"OK","ERROR")
    Perfection!!

    Many pixel-beers for you :D

+ 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