+ Reply to Thread
Results 1 to 9 of 9

Excel Subtotal Returning 0

  1. #1
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6

    Excel Subtotal Returning 0

    I'm creating a custom solution to track basic accounting data for a 20-person organization. I have a listing of accounts that includes primary (parent) accounts and sub-accounts. Each of these accounts can have child accounts (for example, Account 6 is a child to Account 4, which, in turn, is a child to Account 1). In this construct, Account 1 would be purely a parent account, Account 4 would be a sub-parent (parent + child), and Account 6 would be purely a child account. Only purely child accounts have transactions assigned to them on the transactions spreadsheet.

    I'm trying to display subtotals for each of these accounts and, for some unknown reason, keep getting a zero subtotal.

    The table columns include #, Account, Parent, CurrentBalance. The first parent account # is 1.00. The first sub-parent to this account is 1.50 and the first child to 1.50 is 1.51. The following formula will correctly determine if the account has children and correctly determine the appropriate range to subtotal. If the account is a child-only, this formula defaults to the final SUMIFS statement to sum the transactions from a table on another spreadsheet. Using this formula always returns the correct transaction totals, but always leaves the subtotals at zero.

    Please Login or Register  to view this content.
    If I extract the SUMIFS statement (purely copy and paste, no modification), the child-only account summation becomes:

    Please Login or Register  to view this content.
    Using this method, the parent account correctly subtotals. I realize I could use this as a solution, but I need one formula for all of the cells in the subtotal column because accounts can be added/deleted/changed at any time.

    If the first formula correctly shows the child's total, any idea why it doesn't factor into the parent subtotal? My first thought is that the formula is ignoring the child's summation because it considers it a subtotal itself, but if this was the case, why would the extracted SUMIFS statement allow the subtotals to calculate correctly? Also, I've tried trading out the SUMIFS formula for a SUMIF, SUM(IF) and SUMPRODUCT, all of which returned the correct results, but none of which would be included in the parent account subtotal when included in the larger formula.

    Thanks in advance for any help you can provide.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Excel Subtotal Returning 0

    Hi, welcome to the forum

    It can be really hard to trouble-shoot a formula with no context to it, and this can be made even worse with structured table references, so I suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6

    Re: Excel Subtotal Returning 0

    Ford, thanks for the quick reply. The spreadsheet is at work, so I'll try to clean it up and see if I can get on the site through the firewall. If so, I'll upload it tomorrow morning.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Excel Subtotal Returning 0

    Have you tried using sumifs() for the rest of what you want?

  5. #5
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6
    Quote Originally Posted by FDibbins View Post
    Have you tried using sumifs() for the rest of what you want?
    I've tried using every variation of SUM I can think of ... SUMIF, SUM(IF...), SUMIFS, SUMPRODUCT, etc. They all return the result I want until I include them in the larger formula. Once in the larger formula, they return the correct result, but are ignored by the SUBTOTALs.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Excel Subtotal Returning 0

    subtotal will only ignore other ST's

    If they work on their own as sumifs(), perhaps you can just combine them that way?

  7. #7
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6

    Re: Excel Subtotal Returning 0

    Ford,

    Thanks for the feedback. Not sure if that method will meet my requirements, but I'm still experimenting. Can't seem to attach the workbook, so working through that now.

  8. #8
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6

    Re: Excel Subtotal Returning 0

    Ok, I think I've got the workbook attachment working. In it you'll find the first worksheet ("Chart of Accounts"). There are five accounts setup on this table: 2 parent-only and 3 child-only. On the "Income" worksheet, there are two entries relating to Accounts 1.1 and 1.2. On the "Chart of Accounts" sheet, these values are correctly calculated in the "CurrentBalance" table column. However, you can quickly see that only one of these values is being added into the Account 1 subtotal. The value in Row 3 is not being added (it uses the long formula) while the value in Row 4 is being added (uses the extracted formula).
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-15-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    6

    Re: Excel Subtotal Returning 0

    Quick update... I've been doing some experimenting with the issue. I've found that if I replace the SUBTOTAL functions with any other function, the SUMS add correctly into the parent account subtotal. Still can't figure out why, but I'll keep on the issue.

+ 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. need subtotal to also include the matching data in subtotal line
    By baby_kay_2003 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-15-2014, 12:43 AM
  2. Replies: 1
    Last Post: 09-18-2013, 04:10 PM
  3. Replies: 8
    Last Post: 07-31-2012, 09:41 AM
  4. Subtotal - Delete zero Subtotal and prior rows that calculate to that zero Subtotal
    By Whatsherface in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 08:37 PM
  5. VBA: returning subtotal range of pivot tables?????
    By doog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2006, 01:54 PM
  6. Replies: 3
    Last Post: 03-08-2006, 05:25 PM
  7. [SOLVED] Subtotal of Subtotal displays Grand Total in wrong row
    By Thomas Born in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-06-2005, 10:06 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