+ Reply to Thread
Results 1 to 9 of 9

How to sum up items until a minimum threshold is met?

  1. #1
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    How to sum up items until a minimum threshold is met?

    Hi all,

    I'm wondering if anyone can help. I'm trying to sum up the values in a column until a certain value is met, however, I need it based on the lines of "until at least the threshold is met".

    Within my data, I have a list of items (Column A), each with a sales value (column B) and a representation of what % each item accounts for (column C). I need to display in column D which of these items sit within the top 70%, however, the first 5 items make up 69% and the next item take the total up to 78% - meaning the 6th item appears as a "No", when I actually need it to say yes. I've shown the formula that I've currently been trying to use and having issues with.

    I'm not sure if this makes sense, but hopefully my example gives a bit more context. I just need to sum all the items in column C until at least 70% is reached and those items to display a "Y" in column D.

    Is this possible?

    Thanks very much !
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,824

    Re: How to sum up items until a minimum threshold is met?

    Try

    in D5

    =IF(SUM($C$5:C5)<$E$1,"Y",IF(SUM($C4:C$5)<$E$1,"Y","N"))

  3. #3
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: How to sum up items until a minimum threshold is met?

    Hi JohnTopley

    Thank you so much for coming back to me so quickly with this ! In the example, this works perfectly.

    I tried to apply it to my actual data and I hit a bit of a snag (I can post this in a separate thread if that is more appropriate?).

    My actual data is set up a little differently as I'm working off of a pivot where I have different items across different departments, and I'm adding to each item's individual %, a base level % I already have. When I add in the logic of your formula, I get the result I'd expect to see until the last "Y", and then I just get #value errors.

    I can't see though what is causing the value errors.

    The reason for trying to set it up this way is that I have over 127,000 rows in my data, so I need a formula I can drag down which looks at items in relation to the department they sit in (otherwise, I have to ammend the formula for each department to only look at the values in column D per department). e.g. I need to look at the %'s of items in the "fruit" department, seperate to the %'s of items in the veg department.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,824

    Re: How to sum up items until a minimum threshold is met?

    in E5

    =IF(ISNUMBER(SEARCH("Total",$A7)),"",IF(SUM(SUMIFS($D$6:D7,A$6:A7,A7)+INDEX($L$3:$L$4,MATCH($A7,$K$3:$K$4,0)))<$F$2,"Y",IF(SUM(SUMIFS($D$5:D6,$A$5:A6,A6)+INDEX($L$3:$L$4,MATCH($A7,$K$3:$K$4,0)))<$F$2,"Y","N")))
    Attached Files Attached Files
    Last edited by JohnTopley; 06-20-2021 at 04:49 AM.

  5. #5
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: How to sum up items until a minimum threshold is met?

    Hi John,

    Thanks so much again for your time looking into this. I can see that the formula(s) solve the Value errors when you manually enter them into the start of each new section of the pivot. I guess the issue I have is with 1000's of rows, adjusting the formula references at each section is going to take me a while, but I can't really see any other way around it, so guess I'm in for a long night!

    Thanks so much again, I really do appreciate your time.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,824

    Re: How to sum up items until a minimum threshold is met?

    See attached column H:

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



    Includes VBA solution
    Attached Files Attached Files
    Last edited by JohnTopley; 06-19-2021 at 06:18 AM.

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: How to sum up items until a minimum threshold is met?

    A simpler formula =IF(SUMIFS(D$5:D5,A$5:A5,A5)+IFERROR(VLOOKUP(A5,$M$3:$O$4,2,0),0)<=$H$2,"Y","N")

  8. #8
    Forum Contributor
    Join Date
    05-09-2019
    Location
    South West
    MS-Off Ver
    365
    Posts
    113

    Re: How to sum up items until a minimum threshold is met?

    Thank you both for your help with this! The formulas did the job - though needed a bit of tweaking as it was thinking that the subtotal rows in the pivot contained data which should be factoured in, but this has saved me hours of work, so thanks so much !!!!

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,824

    Re: How to sum up items until a minimum threshold is met?

    You're welcome and thank you for the rep.

+ 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: 7
    Last Post: 12-11-2018, 09:44 AM
  2. [SOLVED] Need excel formula that provides a minimum value if calculation is below a threshold
    By kian82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-28-2017, 11:31 AM
  3. Replies: 1
    Last Post: 11-30-2016, 08:02 PM
  4. [SOLVED] Minimum value in all items
    By aganesan99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2015, 10:05 AM
  5. Formula help for bonus calculation with minimum threshold?
    By wisey11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2015, 09:56 AM
  6. Help required - formula to check minimum and maximum threshold
    By ismailm in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-18-2014, 08:33 AM
  7. [SOLVED] Minimum U/Cost for multiple items...
    By muralidaran in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2013, 10:17 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