+ Reply to Thread
Results 1 to 6 of 6

if a positive # subtract the 2 otherwise us an absolute and add the 2

Hybrid View

scalelm if a positive # subtract the... 03-14-2014, 02:40 PM
MrShorty Re: if a positive # subtract... 03-14-2014, 02:55 PM
bebo021999 Re: if a positive # subtract... 03-14-2014, 03:07 PM
bebo021999 Re: if a positive # subtract... 03-14-2014, 03:15 PM
scalelm Re: if a positive # subtract... 03-14-2014, 03:35 PM
MrShorty Re: if a positive # subtract... 03-14-2014, 03:56 PM
  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    orlando, fl
    MS-Off Ver
    Excel 2007
    Posts
    2

    Angry if a positive # subtract the 2 otherwise us an absolute and add the 2



    =IF((F13>0,D13-F13,""),(SUM(ABS(F13)+D13)))

    I'm try to say if F13 is a positive number then take F13 from the larger number D13 OTHERWISE add the F13 and D13 together as an absolute number

    D E F G
    $95,214 -$22,358 -$2,236 $97,450 this formual is =SUM(ABS(F12)+D12) - which works fine until F is a positive number like below

    $95,214 $134,076 $14,897 $110,111

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: if a positive # subtract the 2 otherwise us an absolute and add the 2

    Perhaps my algebra/arithmetic is a little rusty, but do you even need the IF() statement or the ABS() function? It seems to me that simple D12-F12 will do the job:

    1) when F<0 D-(-F)=D+F just by rules of arithmetic around subtracting a negative number.
    2) when F>0 D-(+F)=D-F again just based on basic rules of arithmetic.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: if a positive # subtract the 2 otherwise us an absolute and add the 2

    Sorry, pls ignore this post.
    Quang PT

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: if a positive # subtract the 2 otherwise us an absolute and add the 2

    I think:
    =D13-F13
    follow your both rules?

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    orlando, fl
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: if a positive # subtract the 2 otherwise us an absolute and add the 2

    I think I've been staring at it too long.

    Do you know of a condictional format that will had the #VALUE! until a the number is present?

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: if a positive # subtract the 2 otherwise us an absolute and add the 2

    I don't know about using conditional formatting to return an error value, but you could nest the formula inside of an IF() function that uses something like the ISBLANK() function. =IF(ISBLANK(F2),"nothing to see here",D2-F2)

+ 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: 5
    Last Post: 11-14-2015, 01:12 AM
  2. Replies: 6
    Last Post: 02-03-2014, 05:57 PM
  3. Replies: 0
    Last Post: 04-08-2013, 05:08 AM
  4. Replies: 6
    Last Post: 11-03-2011, 04:44 PM
  5. Replies: 1
    Last Post: 08-14-2009, 11:17 AM

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