+ Reply to Thread
Results 1 to 16 of 16

The who owes what problem

  1. #1
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Question The who owes what problem

    Hi all, this being my first post be gentle. Let me know if this doesn't make sense or I am over complicating the problem.

    I have been struggling to get the output i want from a single formula and the problem goes as follows.

    Total owed = 1 1 1 1 1 1 1 1 1 1 = 10

    Person A = 1 1 2 0 2 1 2 1 0 1 = 11

    Person B = 1 1 0 0 0 0 0 0 0 0 = 2


    Person A owes the Total 2 (Because Person A is yet to pay 4th and 9th payment to the Total)
    Person B owes the Total 8 (Because Person B is yet to pay 3rd to 10th payments to the Total)
    Person B owes person A 2 (Because Person A payed for Person B twice)

    The values payed by Person A and B are always half of each other (i.e Person B payed 100, Person A payed 0, so A owes B 50 and the Total 50) Ideally i would like 4 cell outputs:

    Person A owes Total x amount
    Person B owes Total x amount
    Person A owes Person B x amount
    Person B owes Person A x amount
    Last edited by Kidsan; 05-12-2017 at 05:00 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    1. How is this data (the 1s and 0s) stored?

    All in the same cell?
    Across a series of cells on the same row?
    Some other method?

    2. How many occurrences of these 1s and 0s are you going to have on a row? You have 10 for both Person A and Person B. Will there be more?
    If there are more will they extend to the right of the existing data?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: The who owes what problem

    so in the scenario, if person B had paid for A in months 4 and 9
    what would the result show? they effectively had paid back months 3 and 5?
    Person A = 1 1 2 0 2 1 1 1 0 1 = 11 (doesn't this equal 10?)

    Person B = 1 1 0 2 0 0 0 0 2 0 = 6

    What would the result be? Would person 1 have paid off their part of the loan?

  4. #4
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    Hi K,

    Sorry i couldn't work out hot to put cells in the message.

    All data is in separate cells. Total in column A, Person A in column B and Person B in column C.
    The values are in separate rows down to the sum of the values added together

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    Quote Originally Posted by Kidsan View Post
    Hi K,

    Sorry i couldn't work out hot to put cells in the message.

    All data is in separate cells. Total in column A, Person A in column B and Person B in column C.
    The values are in separate rows down to the sum of the values added together
    2. How many occurrences of these 1s and 0s are you going to have in a column? You have 10 for both Person A and Person B. Will there be more?
    If there are more will they extend down the column of the existing data?

  6. #6
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    Oops sorry I have changed Person A to the correct total

    The values won't extend to more rows in this example but is a lot longer in my problem. I used '1, 2 and 0' as values just for simplicity, but the values on my spreadsheet is money of any quantity but again person A will pay for person B or vise versa.

    If Person A paid for Person B in any of the rows then person B would have to pay them back if Person A's total is over what the 'Overal Total' is.

    I hope this makes sense :/

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    Just use COUNTIF()

    Person A owes Total x amount
    =COUNTIF(B1:B10,0)

    Person B owes Total x amount
    =COUNTIF(C1:C10,0)

    Person A owes Person B x amount
    =COUNTIF(C1:C10,2)

    Person B owes Person A x amount
    =COUNTIF(B1:B10,2)

  8. #8
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    Thanks K, I will give that a go and let you know

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    If you are using values that are not 1 or 2 then you need to have the price stored somewhere, say D1
    else you won't know if Person A has paid just for their own or paid for B's as well.

    Person A owes Person B x amount
    =COUNTIFS(C1:C10=2*D$1,B1:B10,0)

    Person B owes Person A x amount
    =COUNTIFS(B1:B10=2*D$1,C1:C10,0)

  10. #10
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    probs.png

    Just found a way to add a picture

  11. #11
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    Images arent much help, to test any solution EVERYONE has retype the data again.

    If you want us to see what it looks like attach a sample spreadsheet.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.

  12. #12
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    Hopefully this works
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8

    Re: The who owes what problem

    322 is the total owed be both

    A has over payed so B has to give A the sum of the over payment, then has to pay what he owes to the overal total

  14. #14
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: The who owes what problem

    This is not clear.

    In C5 the cost is 100 and A has paid 200 B nothing so presumably A has paid Bs amount.

    But in C10 the cost is 10 B has paid 10 but A has paid 20. Why has A overpaid?

    Also, i one example neither A nor B pay anything!
    So if A overpays the cost and B pays nothing that doesnt necessarily mean A had paid B's amount.

    What exactly are they paying for?A meal? A running total?
    Last edited by Special-K; 05-12-2017 at 06:13 AM.

  15. #15
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    8
    Quote Originally Posted by Special-K View Post
    This is not clear.

    In C5 the cost is 100 and A has paid 200 B nothing so presumably A has paid Bs amount.

    But in C10 the cost is 10 B has paid 10 but A has paid 20. Why has A overpaid?

    Also, i one example neither A nor B pay anything!
    So if A overpays the cost and B pays nothing that doesnt necessarily mean A had paid B's amount.

    What exactly are they paying for?A meal? A running total?
    Correct on the first point.

    The second point your right i shouldn't have done that. The only optionsis one person over paying, paying double or not at all.

    This is a running cost of a month long tour around America. We have a list of things to pre pay, pay while we are there. Sometimes A will book say tye hotels and flights while B has is also booking things etc

    So its a running total of who has paid what and who pays who. The list is going to get lengthy, so thought spreadsheet would be helpful.

  16. #16
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: The who owes what problem

    Ignore sorry misread the question

    Isn't it the sum of the 2 totals divided by 2?
    In this case both A & B owe money
    Last edited by Excelski; 05-12-2017 at 08:59 AM.

+ 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. [SOLVED] Excel Macro - Copy & Paste (Font) problem & Delete Last Added Rows problem
    By LennartB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2015, 06:58 AM
  2. Replies: 3
    Last Post: 02-08-2014, 04:23 PM
  3. input box problem, cell filtering problem, result display while locking sheet
    By croozin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 08:52 AM
  4. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  5. Sort who owes what to whom!
    By mat429 in forum Excel General
    Replies: 0
    Last Post: 10-23-2012, 07:01 AM
  6. Help with grocery 'who owes who' spreadsheet
    By Robotic in forum Excel General
    Replies: 5
    Last Post: 05-18-2011, 03:37 AM
  7. Utility Costs Per Roommate and Who Owes X Amount for Each
    By Neversky in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2008, 04:49 PM

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