+ Reply to Thread
Results 1 to 18 of 18

Formula to subtotal values based on multiple criteria

  1. #1
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Question Formula to subtotal values based on multiple criteria

    This is my first post in the community. I hope I have attached the sample data properly!
    I think I am overcomplicating this problem and could really use some help! I've created some sample data, but the spreadsheet I will be working with is much larger and will be updated weekly with new data. I'm using Excel 365.

    I need to sum GM values for invoices that have trade status of "Not Loaded". I've highlighted the GM values that I need the formula to sum. I would like to subtotal values so when rows are filtered the total adjusts. Any thoughts or advice will be greatly appreciated!!


    Example Data.xlsx

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Formula to subtotal values based on multiple criteria

    You forgot about cell B10, so your result is wrong by your standards.

    Your result | B10 value | new result
    $36,266.24 + $11,414.49 = 47,680.73

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


    The red part is wrong, should be ",".
    Attached Files Attached Files
    Last edited by DJunqueira; 03-21-2024 at 05:06 PM.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    Mmmm, could be tricky. I tried this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, that's $11,414.49 out. And I think that's because there's an invoice, or invoices, that are not included.

    Use this to see what is being totalled for each invoice.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Invoice 5617558 stands out because one of the items is not included in your highlighting.
    Last edited by TMS; 03-20-2024 at 09:02 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    146

    Re: Formula to subtotal values based on multiple criteria

    hi everyone, I allow me to propose this possible solution:

    Please Login or Register  to view this content.
    I hope it result useful.

    Example Data (Solution).xlsx
    Attached Files Attached Files

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,439

    Re: Formula to subtotal values based on multiple criteria

    Cell I42 formula

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

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    @wk9128: your formula returns 0. Am I missing something?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Re: Formula to subtotal values based on multiple criteria

    Thank you DJunqueira for pointing out cell B10 that I missed when calculating a total. I tried to use your formula, but it returned "0". Do you know what I could have done wrong? I thought this would work. I copied the filter portion of the formula into another cell and I see that it returns the correct invoice numbers, but I don't understand why it will not sum. I evaluated the formula and I don't understand why this is happening: SUM({0;0;0;0;0;0;0})

  8. #8
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Re: Formula to subtotal values based on multiple criteria

    Thank you TMS, but when I use this formula I get $0. I copied the second formula to see what is being totaled for each invoice and it returned the correct invoice numbers but all of the values are 0 which I'm assuming is why the end result I get is $0. Any further thoughts on why I returned a $0?

  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
    28,209

    Re: Formula to subtotal values based on multiple criteria

    @TMS re @wk9128:

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


    ranges are wrong in your posted file
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  10. #10
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Re: Formula to subtotal values based on multiple criteria

    Thank you all for trying to help. I'm really not sure why all of the suggested formulas returned zero. I've attached the example data with everyone's formulas in it so maybe someone can help me understand why they all return zero!! Thank you again!
    Attached Files Attached Files

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    @JT: how so? Confused. I just copied the formula and put it in the cell indicated.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    @shainaday88: simple. You have manually entered dollar signs and spaces in the GM values. That makes them text.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    Here's your file back with the values corrected.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Formula to subtotal values based on multiple criteria

    There was a with the formula translator that I use..

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


    The red part should be ",".
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by DJunqueira; 03-21-2024 at 05:16 PM.

  15. #15
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Re: Formula to subtotal values based on multiple criteria

    Thank you TMS!! I was actually in the process of copying and pasting values only to try the suggestions again. I will update once I get it to work! Sometimes it's the simplest mistakes that cause the biggest headaches!

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula to subtotal values based on multiple criteria

    You're welcome. Thanks for the rep.

  17. #17
    Registered User
    Join Date
    03-20-2024
    Location
    Athens, AL
    MS-Off Ver
    MS Office 365
    Posts
    6

    Thumbs up Re: Formula to subtotal values based on multiple criteria

    Thank you ExcelLogan. This is the only formula that updates the same as subtotal would when rows are hidden! I'm not familiar with Map and Lambda, but I look forward to further investigating the functions as they work perfectly for my problem!! Thanks again!

    =SUM(IF(ISNUMBER(XMATCH(B3:B39,FILTER(B3:B39,F3:F39="Not Loaded"))),MAP(G3:G39,LAMBDA(g,SUBTOTAL(9,g))),))

  18. #18
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,439

    Re: Formula to subtotal values based on multiple criteria

    @TMS AND @shainaday88 Get 0, John Topley POST # 9 has already indicated that the reference position is misplaced, and the formula is not a problem. Provide the old method again

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

+ 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] Excel Formula to return multiple values based off of multiple criteria
    By Chase Casey in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-15-2022, 09:21 AM
  2. How to use the SUMPRODUCT Subtotal formula based on TWO criteria
    By Fireflies827 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-15-2020, 11:50 PM
  3. Help with formula to return nth values based on multiple criteria
    By mrbusto71 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2019, 01:05 PM
  4. Formula to Sum 3 Column Values based on Multiple Criteria for Multiple Rows
    By RMerckling in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2016, 07:46 PM
  5. [SOLVED] Formula to Sum Values from a Column Based on Multiple Criteria
    By MaxwellR in forum Excel General
    Replies: 12
    Last Post: 11-29-2013, 03:53 PM
  6. Need Formula to List Values Based on Multiple Criteria
    By lhodgdon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2013, 05:22 AM
  7. Need a Formula to List Values Based on Multiple Criteria
    By lhodgdon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-18-2013, 04:08 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