+ Reply to Thread
Results 1 to 5 of 5

Rounding if formula is less that a certain number

  1. #1
    Registered User
    Join Date
    02-06-2015
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    9

    Rounding if formula is less that a certain number

    I have a line of numbers that I'm summing in a cell (A1). I then have the number the total is supposed to be in A1 as long as everything was entered correctly in another cell (A2). In a third cell (A3), I have a formula subtracting the value of the first cell (A1) from the value of the second cell (A2) to see if the total is off and if so, by how much. If the answer in the third cell is either less than 10 or greater than -10, I would like it just round to zero. If it is outside of that range, I would like it to be the answer to A2-A1. I tried using the following formula: =IF(OR(A2-A1>10,A2-A1<-10),0), but when the answer is outside fo the -10 to 10 range, the answer in the cell is FALSE, which unfortunately does not help me in what I'm trying to do. So, to summarize:
    If A1= 25 and A2= 20, then A3 = -5, and I would like to have A3 show as 0.
    If A1 =20 and A2 = 25, then A3 = 5 and I would like to have A3 show as 0.
    If A1 = 100 and A2 = 50, then A3 = -50 and I would like to have A3 show as -50.
    If A1 = 50 and A2 = 100, then A3 = 50 and I would like to have A3 show as 50.

    Any help would be greatly appreciated. Thank you!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Rounding if formula is less that a certain number

    =IF(ABS(A2-A1)<10, A2-A1, 0)
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-06-2015
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    9

    Re: Rounding if formula is less that a certain number

    Unfortunately, no it did not but thank you very much for your input!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Rounding if formula is less that a certain number

    Oops, think I typed that backwards

    =IF(ABS(A2-A1)<10, 0,A2-A1)
    Is that better?

  5. #5
    Registered User
    Join Date
    02-06-2015
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    9

    Re: Rounding if formula is less that a certain number

    Now that worked like a charm. Thank you!! :D

+ 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. Formula total rounding to even number
    By PlanBVA in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-08-2008, 01:56 PM
  2. No Rounding to whole number formula or format?
    By brandoncartwrig in forum Excel General
    Replies: 4
    Last Post: 09-10-2007, 05:21 PM
  3. What is the formula for rounding a number down?. . .
    By feralhog in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-30-2006, 02:37 PM
  4. Number rounding within a formula
    By T.R. Young in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2005, 11:05 AM
  5. rounding a formula's number
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-09-2005, 04:06 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