+ Reply to Thread
Results 1 to 8 of 8

Summarize by several columns

  1. #1
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Summarize by several columns

    Hi guys! I'm struggling to find a way to summarize my table that has some identical rows into the sum of those duplicate rows. I will upload a file and also a picture.
    I would not mind if the solution is a VBA based one.
    Thank you a lot!

    excelforum-summarize.PNG
    Attached Files Attached Files
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  2. #2
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: Summarize by several columns

    How about something like this...
    Attached Files Attached Files

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Summarize by several columns

    Using Power Query.

    Mcode

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Summarize by several columns

    Quote Originally Posted by day92 View Post
    How about something like this...
    Thank you for your answer, unfortunately I cannot use your solution because it is based on the second table that I do not have. I need to extract the second table from the first (and only one) table.

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Summarize by several columns

    Try in K3

    =IFERROR(LOOKUP(2,1/(COUNTIFS($K$2:$K2,$B$3:$B$13,$L$2:$L2,$C$3:$C$13,$M$2:$M2,$D$3:$D$13,$N$2:$N2,$E$3:$E$13,$O$2:$O2,$F$3:$F$13)=0),B$3:B$13),"")

    Copy down and across till Col O and then in Col R

    In P3

    =IF(K3="","",SUMIFS(G:G,$B:$B,$K3,$C:$C,$L3,$D:$D,$M3,$E:$E,$N3,$F:$F,$O3))

    Copy down and across till Col Q

    summarize-by-several-columns-sample.xlsx
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Summarize by several columns

    Quote Originally Posted by alansidman View Post
    Using Power Query.

    Mcode

    Please Login or Register  to view this content.
    Thank you very much Alan. I haven't used Power Query before but your answer looks like what I need, so better later than never. Thanks again!

  7. #7
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Summarize by several columns

    Quote Originally Posted by Ace_XL View Post
    Try in K3

    =IFERROR(LOOKUP(2,1/(COUNTIFS($K$2:$K2,$B$3:$B$13,$L$2:$L2,$C$3:$C$13,$M$2:$M2,$D$3:$D$13,$N$2:$N2,$E$3:$E$13,$O$2:$O2,$F$3:$F$13)=0),B$3:B$13),"")

    Copy down and across till Col O and then in Col R

    In P3

    =IF(K3="","",SUMIFS(G:G,$B:$B,$K3,$C:$C,$L3,$D:$D,$M3,$E:$E,$N3,$F:$F,$O3))

    Copy down and across till Col Q

    Attachment 655144
    Yes Ace_XL, your solution looks good also. Thank you very much. I'll need to decide what solution I should use, because my table has over 60k rows.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Summarize by several columns

    Quote Originally Posted by day92 View Post
    How about something like this...

    day92
    Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!
    Dave

+ 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] UserForm - Summarize Unique Values from Two Columns
    By yaddles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2017, 09:00 AM
  2. Summarize values in Pivottable for multiple columns
    By ammartino44 in forum Excel General
    Replies: 0
    Last Post: 02-17-2015, 02:51 PM
  3. Summarize items in 2 columns
    By Helniev in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-02-2015, 02:23 PM
  4. Summarize data from columns in multiple sheets to a single datasheet of rows
    By pfi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2014, 10:52 AM
  5. Summarize alpha-numeric contents of columns
    By rdoherty in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2008, 03:14 PM
  6. Summarize based on Multiple Columns
    By Sbubendorf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2007, 06:20 PM
  7. [SOLVED] Concat and summarize 6 columns to 2 columns
    By italia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2005, 03:05 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