+ Reply to Thread
Results 1 to 6 of 6

Rounding in an "IF" funciton

  1. #1
    Registered User
    Join Date
    07-29-2013
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    2

    Rounding in an "IF" funciton

    Hi All ~
    I am new to the forum and I have a quesiton about rounding in an "IF" funciton. I am using the following function:

    =IF(H4>G4,"Above Target",IF(H4<G4,"Below Target",IF(H4=G4,"On Target")))

    The function looks to be working, but I noticed that some of my cells equal, but the function is returning either Above or Below Target. I am guessing this is due to rounding. Anyone know how to correct this so the funciton will return "On Target"?
    Last edited by Tollyseven; 07-29-2013 at 01:37 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Rounding in an "IF" funciton

    Not all that sure why you would want to round if you're returning greater than and less than.

    Do you have some samples of what's in G4 and H4?
    HTH
    Regards, Jeff

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Rounding in an "IF" funciton

    Try

    =CHOOSE(SIGN(ROUND(H4,2)-ROUND(G4,2))+2,"Below","On","Above")&" Target"

    Change the 2 2's to your desired level of rounding accuracy.

  4. #4
    Forum Contributor
    Join Date
    05-24-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Rounding in an "IF" funciton

    or you can use, this will the number

    =IF(ROUND(H4,0)>ROUND(G4,0),"Above Target",IF(ROUND(H4,0)<ROUND(G4,0),"Below Target",IF(ROUND(H4,0)=ROUND(G4,0),"On Target")))

  5. #5
    Registered User
    Join Date
    07-29-2013
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Rounding in an "IF" funciton

    Thanks All! amy_d2 your function work perfect. Thanks so much for the help.

  6. #6
    Forum Contributor
    Join Date
    05-24-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Rounding in an "IF" funciton

    Hi Tollyseven,

    do not forget to mark thread as solved

+ 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] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. "Sub or Funciton Not Defined"
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-03-2012, 01:32 PM
  3. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  4. Replies: 5
    Last Post: 06-26-2006, 09:23 PM
  5. Replies: 7
    Last Post: 05-13-2006, 05:02 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