+ Reply to Thread
Results 1 to 18 of 18

Formula to return total of sub-accounts to the main account

  1. #1
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Exclamation Formula to return total of sub-accounts to the main account

    Hello everyone. I am stuck with this problem. I basically need a formula that adds up the total of sub-accounts and posts that value against the Parent Account. I have a large data sheet so entering manually would take a lot of time. I have attached an excel sheet where i have highlighted in colors the Parent account and their sub accounts. I have manually entered the totals of sub-accounts in column C but i need a formula which would do it automatically.

    To identify how a parent account relates to a sub account is a parent Account say has code 4-001-002 and a sub account has say code 4-001-002-011. The 002 is the identification that the sub account relates to the parent. It would be much easier to understand in the excel sheet i have attached.

    any help would be much needed.
    Attached Files Attached Files
    Last edited by shtuamouth; 06-27-2016 at 03:13 PM.

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Formula to return total of sub-accounts to the main account

    Hello,

    In your attached sample, try this formula in C2:
    Please Login or Register  to view this content.
    Drag it down however long you want. Is this what you were looking for?
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  3. #3
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Thanks a lot Lemice. That made my day. God Bless

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Formula to return total of sub-accounts to the main account

    Glad that I could help.

    If you have found a fitting solution to your problem, please mark the Thread as [SOLVED] using the Thread tools right above post #1. It keeps things neat and tidy.

    And have a great day!

  5. #5
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Dear Lemice and Others.
    I am stuck again. Axtually i have updated the sheet a bit. I have now repeated the same CODE (column B) and Parent Account (column C) for the month of May.

    The formula works fine till D43. But when i added new data of sub-accounts (column E) and its values (column F) from row 37 onwards, the formula does not pick its values from D44 onwards (highlighted in blue color). I guess it repeats the same process.

    Kindly update the formula so that it picks the relevant values of sub-accounts that i may add in for future months. pls see test2.xls

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Formula to return total of sub-accounts to the main account

    That's because you didn't adjust the range to fit the new data.
    The old formula was
    Please Login or Register  to view this content.
    And the new one should look like this:
    Please Login or Register  to view this content.
    Since you inserted a row.

    Let me know if it works with your data.
    Last edited by Lemice; 06-24-2016 at 11:43 AM.

  7. #7
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Dear Lemice.

    It does not work. It recopies the same data from D2 to D43. It does not consider the amounts of the new sub-accounts i posted in blue color from E37-E49.

    Kindly help. I am referring to test2.xls

  8. #8
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Anyone????????????????

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to return total of sub-accounts to the main account

    Is the data in E37:E49 supposed to represent a different month of data? There doesn't appear to be any sort of markers that would separate it from the data above. I believe you're missing a column for Month or a date.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  10. #10
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    yes you are right the data from E37-E49 is of month May whose corresponding values i want to return in D44 onwards.

    Yes there is no separator as i was of the impression to just add new data in E and F columns while the values will automatically be updated in column D.

    The only issue is it works till D43 and after that repeats the same procedure without considering the new data i later entered marked in blue color from E37:F49.

    just to make things clear if you look at the codes F38:F40 totals 12,031 which belongs to D49.

    I think a formula will suffice tht recognizes the code somehow in B and E column.

    If you have a better option kindly let me know. All i am concerned is with returning the corresponding values in column D

  11. #11
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to return total of sub-accounts to the main account

    Do the subaccounts occur once per month? Maybe you want to add up the Nth occurence?

    For example:

    4-001-001-003 : MEDICAL INSURANCE 10
    4-001-001-001 : REPAIR & MAINT - OFFICE EQUIPMENT 10
    4-001-001-003 : MEDICAL INSURANCE 20
    4-001-001-001 : REPAIR & MAINT - OFFICE EQUIPMENT 20
    4-001-001-003 : MEDICAL INSURANCE 30
    4-001-001-001 : REPAIR & MAINT - OFFICE EQUIPMENT 30
    Totals
    Month 1: 4-001-001-003 20
    Month 2: 4-001-001-003 40
    Month 3:4-001-001-003 60

  12. #12
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    I have attached a new file named Copy of test 2-1.xls.

    i have explained in it how is the matching criteria being done to return values. It is not basically about months but matching the codes to return values.

    For instance B4 is a Parent account and E16:E17 are its sub-account. So i need the sum of those sub-accounts to show in D4.

    Column B2:C43 is a fixed format which will not change. the sub-accounts do change so i need to match the codes so they return the corresponding values

  13. #13
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Dear Dafodill did you manage to find anything? If i have been unable to explain properly let me know so i can work on that. thx

  14. #14
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to return total of sub-accounts to the main account

    I'm not sure I understand what your spreadsheet isn't doing. Everything appears to be working correctly. If you decide to add more data, you'll need to change your formula to accommodate the extended range.

  15. #15
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Hi daffodil11. I have attached the complete workbook named "Expense Report (Monthly)".

    Actually the formula is not working the way it should. It does pick the values but not the proper values. I think the formula needs to be changed which i am unable to do so.

    Its the Expense Report tab which shows the columns B,C and D in Sheet1. Its a fixed format which repeats after row43 in Sheet1. I have put in formulas in Expense Report which picks it up from Sheet1 using drop down list against "Jan-Apr" & "May".

    Column F in Sheet1 are sub-accounts. For example F2:F11 in Sheet1 are sub accounts that belong to the Parent account B2. How to know these match up is by looking at their codes. B2 is 4-001-001 and say F6 is 4-001-001-006. The last 006 is the sub code while the rest of the code for both matches. If you use =Lens formula its the first 9 characters from LEFT that match.

    I have manually written the totals in column J in Sheet1 just to show how the column D should show the totals but as i autofill the formula it does not pick the right values in D.

    If you look at Column G in Sheet 1 it is adding F2:F11 and F37:F44 and posting the result in D2. I want F2:F11 to post in D2 and F37:F44 in D44.

    Yes you are right the F2:F36 repeats after the row36 because i copy pasted the data for the month of May with different values.

    I hope u understand what i am stuck with. Kindly help me out as i would be adding in data for each month at that month end in column F and G and whose values would be automatically updated in column D.
    Last edited by shtuamouth; 06-27-2016 at 03:38 PM.

  16. #16
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to return total of sub-accounts to the main account

    See, your real version has months in it, which is what Master Lemice was talking about.

    This should work fine:
    Please Login or Register  to view this content.
    Last edited by daffodil11; 06-27-2016 at 03:46 PM.

  17. #17
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Formula to return total of sub-accounts to the main account

    Thank you so much. God Bless

  18. #18
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to return total of sub-accounts to the main account

    Peace be with you.

+ 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: 2
    Last Post: 07-02-2014, 11:58 PM
  2. Please help, intricate subtotal for main accounts with many sub accounts!!
    By mitch_bossard in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2013, 05:17 PM
  3. Replies: 2
    Last Post: 06-05-2013, 04:19 PM
  4. Insert account & sum accounts
    By kingming in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2013, 11:39 AM
  5. Percentage of total formula taking into account volume
    By msource in forum Excel General
    Replies: 3
    Last Post: 10-12-2009, 09:58 AM
  6. Appearance of sub Accounts when put curser on main account
    By helmekki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2006, 05:06 PM
  7. [SOLVED] Compare Master Account List with Partner Accounts
    By Martin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2005, 11:05 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