+ Reply to Thread
Results 1 to 6 of 6

Aggregating data

  1. #1
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    58

    Aggregating data

    Sample file attached of Contract information - "Aggregate".

    I have 2 Tabs:

    1. "List Info I have (6 Columns)"
    2. "Aggregated Info I want (6 Columns)"

    Each CONTRACT_NO is the main field here, some CONTRACT_NO's have either 1 or 2 Rows of Contract data (colour coded), that I'd like to aggregate/summarise.

    Basically, I want to use the 10 rows of data (from Tab 1), so that it is aggregated down to the 6 rows of data (in Tab 2).

    Thanks for your help.
    Attached Files Attached Files
    Last edited by MarkJohn51; 10-16-2020 at 03:14 PM.

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

    Re: Aggregating data

    This can be partially done with Power Query. Cannot consolidate the Prod Name column. Otherwise, here is the result and the Mcode.

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    10
    PROD_CODE CONTRACT_NO Total Gross Premium Total Fee Total Net Fee
    11
    10P3A
    15196000
    6080
    59.92
    6020.68
    12
    10P3A
    15205210
    4080
    22.36
    4072
    13
    REB5S
    2.76538E+11
    1152.35
    41.96
    1095.55
    14
    45P3A
    16729380
    6037.5
    35.9
    5587.67
    15
    REW5B
    8.76542E+12
    3952.5
    23.82
    3843.85
    16
    WEV1P
    1.11381E+12
    892.4
    39.3
    881.72
    Sheet: 2. Aggregated Info I want
    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

  3. #3
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    58

    Re: Aggregating data

    I am looking to do the aggregation in "normal" Excel.
    It is not essential that I merge the Prod_Name values for the same Contract.

    Thanks for your suggestion, though I would like an Excel solution.

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

    Re: Aggregating data

    FYI: Power Query is part of normal Excel. For more information on it, suggest you look at the links in my signature.

    You may want to look at Sub Total Functionality within Excel if you do not wish to expand into PQ

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Aggregating data

    Please try at
    A2
    =IFERROR(INDEX('1. List Info I have'!A$2:A$12,MATCH(TRUE,INDEX(ISERROR(MATCH('1. List Info I have'!$A$2:$A$12&'1. List Info I have'!$B$2:$B$12,INDEX($A$1:$A1&$B$1:$B1,),)),),))&"","")

    B2
    =IF(A2="","",INDEX('1. List Info I have'!B$2:B$12,MATCH(TRUE,INDEX(ISERROR(MATCH('1. List Info I have'!$A$2:$A$12&'1. List Info I have'!$B$2:$B$12,INDEX($A$1:$A1&$B$1:$B1,),)),),)))

    C2
    =IF(A2="","",IF(COUNTIFS('1. List Info I have'!$A$2:$A$12,A2,'1. List Info I have'!$B$2:$B$12,B2)>1,INDEX('1. List Info I have'!$C$2:$C$12,MATCH(1,INDEX(('1. List Info I have'!$A$2:$A$12=A2)*('1. List Info I have'!$B$2:$B$12=B2),),))&" + ","")&LOOKUP(2,1/('1. List Info I have'!$A$2:$A$12=A2)/('1. List Info I have'!$B$2:$B$12=B2),'1. List Info I have'!$C$2:$C$12)

    D2:F2
    =IF($A2="","",SUMIFS('1. List Info I have'!D$2:D$12,'1. List Info I have'!$A$2:$A$12,$A2,'1. List Info I have'!$B$2:$B$12,$B2))

    or Power Query

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bo_Ry; 10-16-2020 at 03:19 PM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Aggregating data

    This can be done entirely with Power Query, however ...

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Last edited by AliGW; 10-16-2020 at 04:31 PM.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Aggregating Data
    By dc4000 in forum Excel General
    Replies: 3
    Last Post: 02-12-2018, 12:58 PM
  2. Help Sorting and Aggregating Data
    By javeeva in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-10-2017, 10:08 PM
  3. Aggregating Monthly Data
    By willie828 in forum Excel General
    Replies: 3
    Last Post: 11-30-2016, 04:54 PM
  4. Aggregating data
    By brianknie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2013, 01:18 PM
  5. Need help aggregating data
    By glazedfaith in forum Excel General
    Replies: 6
    Last Post: 11-30-2010, 01:29 PM
  6. Aggregating data
    By pilotdata in forum Excel General
    Replies: 6
    Last Post: 11-09-2005, 10:35 AM
  7. [SOLVED] Aggregating data
    By JVLin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-08-2005, 12:06 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