+ Reply to Thread
Results 1 to 13 of 13

formula for a calculation with a varying spreadsheet

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    formula for a calculation with a varying spreadsheet

    I've been trying to figure this out for days but to no avail. Any help would be really apreciated and anything you could do to help would be awesome! I've tried an if statement with AND function with no luck either.

    my spreadsheet looks like this:
    A1 = "One", B1 = 17/08/2013, C1 = 1000.00
    A2 = "Two", B2 = 16/08/2013, C2 = 500.00
    A3 = "One", B3 = 17/07/2013, C3 = 1500.00
    A4 = "Two", B4 = 13/07/2013, C4 = 400.00
    A5 = "Two", B5 = 14/07/2013, C5 = 300.00

    "One" represents the total that needs to be paid and "Two" represents the payments.

    What I want to do is recognise when "One" is present and deduct "two" from that amount, but the whole spreadsheet is never the same (the data is being pasted from somewhere else) so it's really, really difficult to do that.

    So I want to do =1000-500 (for that period, so in D2 it should say 500) and then =1500-400-300 (for the other period so in D5 it should say 800).

    NB: Any payment ("two") that comes in after the 17th of the month will be carried forward to the next months "one"

    Sorry for my horrible explanation. Thank you a lot!
    Last edited by jordan11936; 03-12-2014 at 09:33 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Quite complicated and I'm really struggling working this out. Help please.

    Hi and welcome to the forum. Unfortunately your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: formula for a calculation with a varying spreadsheet

    Done........

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula for a calculation with a varying spreadsheet

    Hi,

    I think you'd better upload an example workbook with all permutations of the order of column A rows if relevant. Then add the results you expect to see with some notes explaining your calculation.

  5. #5
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: formula for a calculation with a varying spreadsheet

    I've attached a file for you to look at

    On each line there is a "One" (debit) it shows the balance in a new column, adding in all the "Two" (credits) that have been received for that month
    Attached Files Attached Files

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: formula for a calculation with a varying spreadsheet

    Maybe this will be of value in getting a solution.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: formula for a calculation with a varying spreadsheet

    Quote Originally Posted by ThirtyTwo View Post
    I've attached a file for you to look at

    On each line there is a "One" (debit) it shows the balance in a new column, adding in all the "Two" (credits) that have been received for that month
    that's absolutely excellent! thank you very very much!

    Couple of problems I hope you can address:

    1) Sometimes, there can be 6 "Debits" in the same month with subsequent credits coming underneath so this will be something I have to deal with . Sorry for not mentioning it before!

    2) Sometimes, there can be 10+ credits under the debit and I don't think the formula can account for that. The collumn can stretch down to 150 rows

    3) to add another spanner into the works... In between the debits and the credits, there can be useless stuff, we'll call "three", "four" and "five" that will have figures and dates, but won't be relevant to the calculation.

    Been trying to wrap my head around this in such a short time. Formulas be hard! I'm wondering if we can start it with =If(A2="Debit",....) obviously keeping in mind the varying nature of the spreadsheet.

    Thanks again. You guys are my Excel hero's.
    Last edited by jordan11936; 03-13-2014 at 09:53 PM.

  8. #8
    Forum Contributor
    Join Date
    01-25-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    434

    Re: formula for a calculation with a varying spreadsheet

    Quote Originally Posted by jordan11936 View Post
    that's absolutely excellent! thank you very very much!

    Couple of problems I hope you can address:

    1) Sometimes, there can be 6 "Debits" in the same month with subsequent credits coming underneath so this will be something I have to deal with . Sorry for not mentioning it before!

    2) Sometimes, there can be 10+ credits under the debit and I don't think the formula can account for that. The collumn can stretch down to 150 rows

    3) to add another spanner into the works... In between the debits and the credits, there can be useless stuff, we'll call "three", "four" and "five" that will have figures and dates, but won't be relevant to the calculation.

    Been trying to wrap my head around this in such a short time. Formulas be hard! I'm wondering if we can start it with =If(A2="Debit",....) obviously keeping in mind the varying nature of the spreadsheet.

    Thanks again. You guys are my Excel hero's.
    1) Sometimes, there can be 6 "Debits" in the same month with subsequent credits coming underneath so this will be something I have to deal with . Sorry for not mentioning it before!

    2) Sometimes, there can be 10+ credits under the debit and I don't think the formula can account for that. The collumn can stretch down to 150 rows


    Row references have been removed so it now looks at the entire column
    Please Login or Register  to view this content.
    3) to add another spanner into the works... In between the debits and the credits, there can be useless stuff, we'll call "three", "four" and "five" that will have figures and dates, but won't be relevant to the calculation.

    With this change it firstly adds up all the One's, then adds in all the Two's (the negatives)
    Please Login or Register  to view this content.
    This can be entered into F2, copy and pasted down

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: formula for a calculation with a varying spreadsheet

    Can you post a more up to date example of your workbook showing the complications that you mention above?

    Is all this activity on one account or are there several accounts involved here?

  10. #10
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: formula for a calculation with a varying spreadsheet

    No problem ill do that tonight at8.30gmt when I get in from work.

    Its thousands of accounts Im working with. Our current software doesnt show us the credit coming off tthe debit for the period ending 16th, just a running total.

  11. #11
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: formula for a calculation with a varying spreadsheet

    Quote Originally Posted by newdoverman View Post
    Can you post a more up to date example of your workbook showing the complications that you mention above?

    Is all this activity on one account or are there several accounts involved here?
    here is an example of what I mean. the "I" column is what i want to replicate (with a formula) keeping in mind that B23:B25 is useless stuff.

    The spreadsheet always changes, so "useless 5" could be in B3 next time. Also notice some Debits come in without Credits and 6 credits come in a row!

    One more thing is that the credit's must have a "-" at the end of it which can be amended with a formula in the I column, I just forgot how!


    Thanks guys for all the hard work
    Attached Files Attached Files
    Last edited by jordan11936; 03-14-2014 at 05:58 PM.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: formula for a calculation with a varying spreadsheet

    Am I correct in thinking that this worksheet is calculated from BOTTOM to TOP with all new entries at the top as it appears.

  13. #13
    Registered User
    Join Date
    03-11-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: formula for a calculation with a varying spreadsheet

    Quote Originally Posted by newdoverman View Post
    Am I correct in thinking that this worksheet is calculated from BOTTOM to TOP with all new entries at the top as it appears.
    Correct. It's not a running total though - I have a formula for that. I need to calculate each month.

+ 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] VBA code is working, but struggling to store the output
    By n_ant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2013, 07:18 PM
  2. [SOLVED] Struggling to get a small search function working correctly
    By bodhi808 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2013, 08:34 PM
  3. Excel 2007 : Help simple and complicated not working
    By Mcullin@choicecabine in forum Excel General
    Replies: 1
    Last Post: 11-08-2011, 08:12 PM
  4. Struggling with complicated counts
    By Dabblerj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2007, 01:02 PM
  5. Complicated stuff! Struggling with VBA
    By geff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2007, 05:55 PM

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