+ Reply to Thread
Results 1 to 15 of 15

Sumifs formula to add multiple columns based on same criteria

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    Perth, Australia
    MS-Off Ver
    Microsoft 365 MSO 2405
    Posts
    47

    Sumifs formula to add multiple columns based on same criteria

    Dear Team,

    I would like to ask your help to do the sumifs of multiple columns based on the same criteria without the helper column. I had attached the same file for more clarity

    Sumifs.xlsx

    Earlier I was using Sum product formula but it was very slow, since my live file is having around 10,000+ Rows

    Please support

    Thanks and Regards
    R. Vadivelan

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Sumifs formula to add multiple columns based on same criteria

    Try this:

    =SUM(FILTER($C$3:$F$6,($A$3:$A$6=H3)*($B$3:$B$6=I3)))

  3. #3
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,898

    Re: Sumifs formula to add multiple columns based on same criteria

    Another way, clean all expected results.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,988

    Re: Sumifs formula to add multiple columns based on same criteria

    =if($h3<>"",sum(index($c$3:$f$100000,match($h3&$i3,$a$3:$a$100000&$b$3:$b$100000,0),)),"")

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    Or this much simpler spill formula:

    =VSTACK(HSTACK(A2:B2,"Total"),SORTBY(HSTACK(A3:B6,BYROW(C3:F6,LAMBDA(r,SUM(r)))),A3:A6,,B3:B6,))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    03-04-2012
    Location
    Perth, Australia
    MS-Off Ver
    Microsoft 365 MSO 2405
    Posts
    47

    Re: Sumifs formula to add multiple columns based on same criteria

    Thank You Ali for your support, It works fine

  7. #7
    Registered User
    Join Date
    03-04-2012
    Location
    Perth, Australia
    MS-Off Ver
    Microsoft 365 MSO 2405
    Posts
    47

    Re: Sumifs formula to add multiple columns based on same criteria

    Thanks for your reply, it works

  8. #8
    Registered User
    Join Date
    03-04-2012
    Location
    Perth, Australia
    MS-Off Ver
    Microsoft 365 MSO 2405
    Posts
    47

    Re: Sumifs formula to add multiple columns based on same criteria

    Thanks for your help, it works

  9. #9
    Registered User
    Join Date
    03-04-2012
    Location
    Perth, Australia
    MS-Off Ver
    Microsoft 365 MSO 2405
    Posts
    47

    Re: Sumifs formula to add multiple columns based on same criteria

    Thanks for your simpler formula, it works fine. However I would like to ask your support to apply the same formula with blank columns in between.

    I.e In case there sum values are from C:D and G:H then how we can modify the above formula

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    Provide an updated sample workbook.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    Actually, if the columns are blank (REALLY blank), then this would work:

    =VSTACK(HSTACK(A2:B2,"Total"),SORTBY(HSTACK(A3:B6,BYROW(C3:H6,LAMBDA(r,SUM(r)))),A3:A6,,B3:B6,))
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    If the intervening columns are NOT blank, try this:

    =VSTACK(HSTACK(A2:B2,"Total"),SORTBY(HSTACK(A3:B6,BYROW(HSTACK(C3:D6,G3:H6),LAMBDA(r,SUM(r)))),A3:A6,,B3:B6,))

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    Please continue here for this and the earlier (closely related) XLOOKUP query - they are part and parcel of the same thing. Thanks.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    And in case you want it on another worksheet:

    =VSTACK(HSTACK(Sheet1!A2:B2,"Total"),SORTBY(HSTACK(Sheet1!A3:B6,BYROW(HSTACK(Sheet1!C3:D6,Sheet1!G3:H6),LAMBDA(r,SUM(r)))),Sheet1!A3:A6,,Sheet1!B3:B6,))

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: Sumifs formula to add multiple columns based on same criteria

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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: 1
    Last Post: 04-09-2021, 11:09 AM
  2. Replies: 4
    Last Post: 06-14-2017, 01:51 AM
  3. [SOLVED] using SUMIFS and adding values based on multiple criteria based on selection from the drop
    By muheebrahman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2015, 12:55 AM
  4. Replies: 3
    Last Post: 06-17-2014, 01:13 PM
  5. SUMIFS or SUMPRODUCT with Multiple Columns and with Date Criteria
    By eac8423 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-04-2014, 05:20 PM
  6. Need help understanding sumifs columns with multiple criteria
    By igoodable in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2014, 02:27 PM
  7. how can I have a formula result based on multiple criteria/columns
    By nicky_p in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-05-2006, 08:50 AM

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