+ Reply to Thread
Results 1 to 10 of 10

Multi-Level Parent Summation (BOM type)

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Multi-Level Parent Summation (BOM type)

    Hi, I'm looking for a formula that can sum BOM-style levels, where a higher number (e.g 5) is always a child of a lower number (e.g. 4). I've seen some formulas that are close, but I can't tweak them to get exactly what I want. Hope someone can help!
    In the example below, the first column is the level number, the second is the values that will have been entered. The Third column is what i want the formula to calculate.

    Level Child Values Parent / Total SUMS
    0 130
    1 43
    2 25 25
    2 18
    3 18
    4 18
    5 18
    1 87
    2 27 27
    2 60
    3 30
    3 30
    0 115
    1 26 26
    1 89
    2 89
    Last edited by LucyL; 09-09-2022 at 04:05 PM. Reason: Typo in the table

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Multi-Level Parent Summation (BOM type)

    Hello LucyL and Welcome to Excel Forum.
    This provides the numbers down to the second zero which I assume starts a new product:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In the future, please utilize the information in the "HOW TO ATTACH YOUR SAMPLE WORKBOOK" banner at the top of the page to attach a file to your posts.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Multi-Level Parent Summation (BOM type)

    JeteMc, thanks so much for your help, I think it's really close, but I'm having an issue with the formula, if I add more lines
    (see the red in the attached workbook), so that there are more than 2 rows at the same level, it breaks.

    can you help?

    Thanks very much
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Multi-Level Parent Summation (BOM type)

    Does this do the trick?

    =SUM(IF(ROW(A2:$A$20)-ROW(A2)<IFERROR(MATCH(TRUE,A3:$A$20<=A2,0),ROWS(A3:$A$20)),B2:$B$20,0))

    I'm a bit confused why the parent/total SUMS columns seems to sometimes include the child values and other times not. e.g. why is it 25 in row 4 (the first row of level 2) but blank in rows 12 and 13? Also not sure why the last 2 rows are 89 with no child values.

  5. #5
    Registered User
    Join Date
    03-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Multi-Level Parent Summation (BOM type)

    Quote Originally Posted by nick.williams View Post
    Does this do the trick?

    =SUM(IF(ROW(A2:$A$20)-ROW(A2)<IFERROR(MATCH(TRUE,A3:$A$20<=A2,0),ROWS(A3:$A$20)),B2:$B$20,0))

    I'm a bit confused why the parent/total SUMS columns seems to sometimes include the child values and other times not. e.g. why is it 25 in row 4 (the first row of level 2) but blank in rows 12 and 13? Also not sure why the last 2 rows are 89 with no child values.
    Hi Nick, thanks for helping.

    First, no real reason why the child values aren't pulled over. They could be. Second, no, that formula doesn't work. It gives a running total for all the rows, and I need totals for each parent.

    I've attached another update, this time with all the children pulled over. (Edited to update attachment)
    Attached Files Attached Files
    Last edited by LucyL; 09-12-2022 at 12:06 PM. Reason: Update attachment

  6. #6
    Registered User
    Join Date
    03-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Multi-Level Parent Summation (BOM type)

    JeteMC, I took out the "AND" from the first part of the formula, and it seems to work the way I want (fingers crossed) - I'll do some more testing but thanks so much!

    Edited to be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Multi-Level Parent Summation (BOM type)

    Lucy - for me it gives the same result as the formula of JeteMc, other than a couple of rows where JeteMc's formula gives 0 which I think was your issue. This is mostly the same as your column C, although I think you forgot to update it when you added in the new rows 16&17. Also I think B19 should be 89 rather than blank?

    Which value is it giving incorrectly for you?
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Multi-Level Parent Summation (BOM type)

    RE: Post #6. You're Welcome. By the way, since the AND function is removed the parentheses around A2=A3 could be removed i.e. =IF(A2=A3,B2,...
    If after testing the formula you find it to be satisfactory, please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post.
    Let us know if you have any questions.

  9. #9
    Registered User
    Join Date
    03-28-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Multi-Level Parent Summation (BOM type)

    I have found there is still one issue with the formula, when the child values are null, it doesn't just grab the parent value present by default. Row 16, Column D should be "15".

    Excel.PNG

    The total rollups are fine, I would just like it to get the parent value by default if the children are null.
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Multi-Level Parent Summation (BOM type)

    Try the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.

+ 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] Extracting the 1 level lower part numbers based on Level numbers in multi level BoM
    By Sekars in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-03-2022, 05:35 AM
  2. Macro needed to convert multi-level BOM to single-level BOM as per attached file
    By AhmedSaad in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 05-12-2021, 08:31 AM
  3. Format the second level of multi-level category axis - clustered chart
    By mushkitoes in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-04-2018, 09:30 AM
  4. [SOLVED] creating Multi-level list styles using existing multi-level list?
    By JimmyWilliams in forum Word Formatting & General
    Replies: 2
    Last Post: 08-28-2017, 12:21 AM
  5. Conditional summation of a multi=level parts list
    By sheldh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2014, 07:31 PM
  6. Bill of Materials conversion from multi level to single level
    By susmitpatel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-11-2013, 12:53 AM
  7. Multi-Level Array Type Mismatch Error
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2009, 06:20 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