+ Reply to Thread
Results 1 to 6 of 6

Proper use of SUMPRODUCT to split expenses?

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    33

    Question Proper use of SUMPRODUCT to split expenses?

    Hi everyone, what's the proper way to sum up the total cost of each individual person (using sumproduct or otherwise)?

    The worksheet looks like this:

    A B C D E F
    1 Expense Cost PersonA PersonB PersonC PersonD
    2 Restaurant $150 1 1 1 1
    3 Movies $50 1 1 1 1
    4 Gas $30 1 1
    5 Souvenirs $10 1 1

    A "1" in a person's column indicates that expense cost is evenly split to them. Blank indicates they were not part of that expense.

    I have another table like this to summarize:

    Owe
    PersonA
    PersonB
    PersonC
    PersonD

    I think in the Owe column, the formula should be something like

    =SUMPRODUCT(B:B, C:F, --(C1:F1 = (cell with person's name)), (cell of person divided by sum of each row))

    but I haven't been able to figure it out.

    Thanks in advance!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Proper use of SUMPRODUCT to split expenses?

    Are you saying that a quarter of the Restaurant cost (i.e. $37.50) is allocated to each person, but half of the Gas cost (i.e. $15.00) is allocated only to PersonA and PersonC ?

    Pete

  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Proper use of SUMPRODUCT to split expenses?

    Yes, exactly that. All the expenses were evenly split if a person participated.
    Last edited by AliGW; 07-10-2019 at 12:06 PM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Proper use of SUMPRODUCT to split expenses?

    I set this up as you have shown it, with "personA" in cell A10 in your lower table, and then you can use this formula in B10:

    =SUMPRODUCT($B$2:$B$5*(INDEX($C$2:$F$5,0,MATCH(A10,$C$1:$F$1,0))/$G$2:$G$5))

    Copy this down to B13.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    03-06-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Proper use of SUMPRODUCT to split expenses?

    Thanks Pete. G2:G5 would be the sum of their respective row?

    That solution works!

    Just curious, would it be possible to do it without added an additional column to the data?

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Proper use of SUMPRODUCT to split expenses?

    Yes, sorry I forgot to mention that I added this formula to G2:

    =SUM(C2:F2)

    and then copied it down. I think it would be a much more awkward formula without that helper column - you can always hide the column if you don't want to see it.

    Hope this helps, and thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

+ 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: 8
    Last Post: 02-20-2018, 09:45 AM
  2. [SOLVED] table calculation with name duplicates and split columns - where sumproduct fails...
    By BuZZarD73 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-25-2014, 07:46 AM
  3. Replies: 2
    Last Post: 07-01-2014, 02:11 PM
  4. [SOLVED] SUMPRODUCT #VALUE Error - Req it to look at split ranges and treat blanks as 1
    By marsham in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-20-2013, 06:18 PM
  5. [SOLVED] Proper syntax for a SUMPRODUCT() function?
    By billj in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-15-2013, 01:34 PM
  6. [SOLVED] Expenses
    By stephaniex3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-11-2012, 10:39 PM
  7. Replies: 4
    Last Post: 08-09-2012, 04:55 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