+ Reply to Thread
Results 1 to 17 of 17

Formula to display difference as a positive number.

  1. #1
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Formula to display difference as a positive number.

    I have a range of cells (I7:I42 ).

    The total of which, I would like to subtract from the value of cell J43.

    If the total of the range (I7:I43) is greater than J43,

    I want the difference to display in C3 as a positive number.

    Any help would be greatly appreciated.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to display difference as a positive number.

    see ABS function, eg:

    =ABS(J43-SUM(I7:I43))

  3. #3
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    Thank you, the ABS function did work, but it does not meet my requirements

    "If the total of the range (I7:I43) is greater than J43,

    I need the "difference" to display in C3 as a positive number.

    eg: "it the cell range total (I7:I42) = 25 and the cell total (J43) =
    22, then I need the number 3 to be displayed in appropriate cell.

    Thank You again for you help.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to display difference as a positive number.

    I have a range of cells (I7:I42 ).

    The total of which, I would like to subtract from the value of cell J43.

    If the total of the range (I7:I43) is greater than J43,
    Which is it? If not I7:I43, then

    =ABS(J43-SUM(I7:I42))
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    Either range, the result needs to be the same.

    C3 needs to be either Zero or the greater difference between the total of the range
    and the reference cell

    eg:"if the cell range total between (I7:I42) = 25 and cell J43 = 22, I then I need the greater difference "3" to be displayed in the appropriate cell of C3".

    "or"

    eg:"if the cell range total between (I7:I42) = 15 and cell J43 = 22, I then I need "0" to be displayed in cell C3".

    "or"

    eg:"if the cell range total between (I7:I42) = 100 and cell J43 = 22, I then I need the greater difference of "78" to be displayed in the appropriate cell of C3".
    Last edited by Ashone; 04-17-2010 at 12:13 PM.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to display difference as a positive number.

    Maybe just =SUM(I7:I43) - J43

  7. #7
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    shg ...

    Thanks, but still no help....

  8. #8
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    Quote Originally Posted by shg View Post
    Maybe just =SUM(I7:I43) - J43
    Thanks, but still not working...

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Formula to display difference as a positive number.

    can you upload example with your input and desired output and also describe what doesn't work?

  10. #10
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    disregard last upload
    Attached Files Attached Files
    Last edited by Ashone; 04-17-2010 at 02:39 PM.

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to display difference as a positive number.

    my turn
    perhaps
    =MAX(0,SUM(I7:I43) - J43)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  12. #12
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    HELP.xlsx


    This is the correct example worksheet.

  13. #13
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    martinwilson....

    You are VERY, VERY close

  14. #14
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    CORRECTION to Worksheet

    I need formula for B8, E8 and H8

    Sorry for all the confusion, And Thank you for all your help...and patience

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to display difference as a positive number.

    very close?
    for your sheet you'd need in c8
    =MAX(0,SUM(B1:B6)-C7) or even just =MAX(0,B7-C7)

  16. #16
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    Hip, hip, hurray...i've found my excel hero.

  17. #17
    Registered User
    Join Date
    04-17-2010
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Formula to display difference as a positive number.

    Thanks a Million

+ 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