+ Reply to Thread
Results 1 to 9 of 9

How to create a grouping from multiple rows and assign rankings

  1. #1
    Registered User
    Join Date
    08-18-2020
    Location
    London
    MS-Off Ver
    Outlook365
    Posts
    22

    How to create a grouping from multiple rows and assign rankings

    Hi,

    I would like to understand how to summarise and group detail rows, which can have multiple statuses and rank the statuses so only the most relevant status is shown.

    As an example:

    Row 1 ProductA Planning
    Row 2 ProductA Design
    Row 3 ProductA Ready
    Row 4 ProductB Design
    Row 5 ProductB
    Row 6 ProductB Planning

    should be summarised as

    Group1 ProductA Ready
    Group2 ProductB Design

    I've attached a sample file which hopefully makes the ask clearer...

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to create a grouping from multiple rows and assign rankings

    Hi,
    A helper column in the Detail table that holds the Status Rank using an INDEX(MATCH()) formula will probably needed, and then a Pivot Table - probably for analysing it.

    However you'll need to clearly explain how your required results relate to the original data. Manually Add exactly what you want to see and explain the rules you've used to obtain the results. For instance if the Summary expected in B2:D7 is exactly what you want, explain how D3 gets the status of Ready. Is the rule that you take the lowest status ranking for any Product from the Detail table and apply that Status description?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-18-2020
    Location
    London
    MS-Off Ver
    Outlook365
    Posts
    22

    Re: How to create a grouping from multiple rows and assign rankings

    Hi Richard,

    If you open the attachment in the original post, I have included the expected results on the second tab.

    You need to look at the 'Status Ranking' in A12:B16 of this tab in order to understand how the summarisation derives the correct status.

    In the example posted above, you want to get the latest status in the delivery process, so you'd assume a ranking of:
    3. Planning
    2. Design
    1. Ready
    Therefore, ProductA = Ready, and ProductB = Design.

    The spreadsheet includes some statuses with equal ranking. These groupings would be returned as "Conflict".

    Does this help clarify?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to create a grouping from multiple rows and assign rankings

    Hi,

    I did open the workbook. It certainly wasn't clear that the 'latest' status which you now mentions was the status with the lowest number, hence my surmise as to the rules.

    The attached seems to give you what you want if you include the two Helper columns
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-18-2020
    Location
    London
    MS-Off Ver
    Outlook365
    Posts
    22

    Re: How to create a grouping from multiple rows and assign rankings

    Thank you for your response. The suggestions look very promising.

    However, I've noticed that if the core values change, the derived values in the helper columns do not necessarily have the expected results.

    For example, if the statuses of D10:D12 were to change so that they trigger the Conflict rule, Status2 doesn't update to reflect that they have conflicting statuses.

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

    Re: How to create a grouping from multiple rows and assign rankings

    Please try at
    C3
    =UNIQUE(Detail!C3:C14)

    D3 for only Confilct with Ready and Not Needed.
    =IF(MMULT(COUNTIFS(Detail!C3:C14,C3#,Detail!D3:D14,TRANSPOSE(B12:B13)),{1;1})>1,"Confilct",XLOOKUP(C3#,Detail!C3:C14,Detail!D3:D14,,,-1)&"")

    or with any conflict

    =IF(ISNA(MODE.MULT(TRANSPOSE(FILTER(XLOOKUP(Detail!$D$3:$D$14,$B$12:$B$16,$A$12:$A$16,""),Detail!$C$3:$C$14=C3)))),VLOOKUP(C3,SORTBY(Detail!$C$3:$D$14,XLOOKUP(Detail!$D$3:$D$14,$B$12:$B$16,$A$12:$A$16,"")),2,0)&"","Confict")
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-18-2020
    Location
    London
    MS-Off Ver
    Outlook365
    Posts
    22

    Re: How to create a grouping from multiple rows and assign rankings

    Wow, that's so complex I can't actually figure out what's happening enough to troubleshoot it when I transcribe it.

    I've sanitised the target workbook and attached it. When I transcribe, I'm getting a #VALUE error, but can't trace what the cause is. Can you spot it?
    Attached Files Attached Files

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

    Re: How to create a grouping from multiple rows and assign rankings

    Try
    =IF(MMULT(COUNTIFS(Detail!B5:B2397,C5#,Detail!F5:F2397,TRANSPOSE('Cover Sheet'!$L$2:$L$3)),{1;1})>1,"Conflict",XLOOKUP(C5#,Detail!B5:B2397,Detail!F5:F2397,,,-1)&"")

  9. #9
    Registered User
    Join Date
    08-18-2020
    Location
    London
    MS-Off Ver
    Outlook365
    Posts
    22

    Re: How to create a grouping from multiple rows and assign rankings

    Thank you, that's resolved the error so that it returns values. However, the results returned are often not consistent with the values in the detail tab. For instance, returning null values when there is a value to return, or showing 'Conflict' when there is no conflict trigger.

    Thoughts?

+ 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] Search Rankings in 4 groups of 4 names and insert rankings in spreadsheet
    By PhilBar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2020, 09:14 AM
  2. [SOLVED] Create a Grouping Macro, using an Outline column to quickly group rows
    By JimmyWilliams in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-31-2017, 10:29 PM
  3. Help! Want to create a leaderboard based on rankings in several different tables.
    By Tallulah2408 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2017, 05:26 PM
  4. Create Multiple Command Button Assign to different macros
    By Konexcelmath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2013, 05:40 AM
  5. Grouping and filtering multiple rows
    By Tradesman in forum Excel General
    Replies: 3
    Last Post: 02-28-2013, 01:58 PM
  6. converting weekly rankings into monthly rankings
    By sfinns in forum Excel General
    Replies: 6
    Last Post: 02-09-2012, 08:51 AM
  7. Assign Rankings according to values automatically
    By delliott777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2008, 05:14 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