+ Reply to Thread
Results 1 to 4 of 4

IF Statement - where it compares similar values

  1. #1
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    IF Statement - where it compares similar values

    Is it possible to write an IF statement (or other type of formula) where you are comparing two numbers and you want to make sure the whole numbers are correct but you don't care about what's after the decimals?
    Example:
    In A1= 21.05556
    In A2= 21.15

    Is it possible to write a formula that basically states A1=A2 (or if A1=A2 then 'correct') in the example above?

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,738

    Re: IF Statement - where it compares similar values

    =IF ( INT(A1)=INT(A2), "Correct", "NOT Correct")

    INT just takes the bit before the decimal Integer
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    Re: IF Statement - where it compares similar values

    Beautiful, that worked.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,738

    Re: IF Statement - where it compares similar values

    you are welcome

+ 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. Replies: 22
    Last Post: 04-15-2022, 08:08 PM
  2. Replies: 3
    Last Post: 12-12-2012, 11:52 AM
  3. IF Statement that compares multiple cells and gives me the lowest number
    By williamfrus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2012, 07:37 PM
  4. Macro that compares values in a list and add and deletes values.
    By keis386 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 04:17 PM
  5. Macro to replace IF statement that compares 2 cellls
    By ge0rge in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-16-2008, 06:15 AM
  6. IF statement (non nested) that compares cell value against range
    By r2d3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-10-2006, 08:11 AM
  7. IF statement (non nested) that compares cell value against range
    By r2d3 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-03-2006, 06:10 PM

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