+ Reply to Thread
Results 1 to 8 of 8

Sum the surplus

  1. #1
    Registered User
    Join Date
    11-15-2008
    Location
    Mumbai
    Posts
    26

    Sum the surplus

    Hi,

    I want to Sum up the difference between base value= 5 and cell value

    if the table is like

    A2:2
    A3:6
    A4:7

    I want the summation of excess than base value=5
    which is equal to 3
    Regards,

    ---Yogi

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

    Re: Sum the surplus

    I don't understand how you get 3 from your result of 15 with base of 5 - surely it's 0 - ie:

    =MOD(SUM(A2:A4),5)

    Ah, hang on maybe you mean

    =SUMPRODUCT(--(A2:A4>5),A2:A4-5)

    or even

    =SUMIF(A2:A4,">5")-5*COUNTIF(A2:A4,">5")

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

    Re: Sum the surplus

    7+6+2 =15
    surplus after dividing by 5 is 0
    3 lots of 5 no surplus
    what do you mean?
    "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

  4. #4
    Registered User
    Join Date
    11-15-2008
    Location
    Mumbai
    Posts
    26

    Re: Sum the surplus

    what if I need to count the excess time spend instead of just numbers

  5. #5
    Registered User
    Join Date
    11-15-2008
    Location
    Mumbai
    Posts
    26

    Re: Sum the surplus

    what if I need to count the excess time spend instead of just numbers

  6. #6
    Registered User
    Join Date
    11-15-2008
    Location
    Mumbai
    Posts
    26

    Re: Sum the surplus

    Hey Guys Kindly check the following,
    is this ok

    ---Yogi
    Attached Files Attached Files

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

    Re: Sum the surplus

    you can get the same result
    with
    =SUMIF(B4:B6,">"&B1,B4:B6)-COUNTIF(B4:B6,">"&B1)*B1

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

    Re: Sum the surplus

    Hi Martin, in this instance there is no need to set the optional sum_range in the SUMIF given the intial range contains values to SUM, eg:

    =SUMIF(B4:B6,">"&B1)-COUNTIF(B4:B6,">"&B1)*B1

    (resulting cell set to format of h:mm:ss)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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