+ Reply to Thread
Results 1 to 4 of 4

IF THEN with math

  1. #1
    Registered User
    Join Date
    04-09-2010
    Location
    Fairfax, VA
    MS-Off Ver
    Excel 2007
    Posts
    5

    IF THEN with math

    After completing a calculation it is possible that the answer will be a negative. I need some method of essentially flipping the sign and I was thinking of multiplication by -1.

    The first thing that came to mind was IF THEN ELSE, but I do not know how to basically do "IF Value <0 THEN (Cell Value *-1) ELSE Leave it alone"

    Is this possible or do I need to bark up another tree?

    Thanks for the assist.

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: IF THEN with math

    It sounds like you want the absolute value. The worksheet function is =ABS(A1) where cell A1 has either a positive or negative value.

  3. #3
    Registered User
    Join Date
    04-09-2010
    Location
    Fairfax, VA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: IF THEN with math

    I completely forgot about ABS()

    Here is the Formula is it stands currently =IF(G36=0,0,IF((G36-H36)+K36<0,0,(G36-H36)+K36)) and it resides in I36.

    Can the ABS used here in place of the first 0 after the <0

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: IF THEN with math

    Hi Soglejr, you should be able to use:

    =IF(G36=0,0,IF(G36-H36+K36<0,0,ABS(G36-H36+K36)))

    You shouldn't need to specify (G36-H36)+K36, since by order of operations they will be calculated from left-to-right anyway.

+ 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