Results 1 to 6 of 6

Comparing Rank vs Grouping to determine Outcome

Threaded View

  1. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Comparing Rank vs Grouping to determine Outcome

    You could use Power Query to transform your data and calculate the Outcome per row. Format your source data as a table, then use:

    let
    
        ModifyPartition = (MyPartition) =>
            let
                MinRank = List.Min(MyPartition[Rank]),
                MasterLabel = Text.Combine({if Table.RowCount(Table.SelectRows(MyPartition, each ([Rank] = MinRank))) > 1 then "Joint" else null,"Master"}," "),
                AddOutcome = Table.AddColumn(MyPartition, "Outcome", each if [Rank] = MinRank then MasterLabel else "Non Master", type text)
            in
                AddOutcome,
    
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Channel", type text}, {"GROUP_ID", Int64.Type}, {"Rank", Int64.Type}}),
        #"Partitioned Groups" = Table.Group(#"Changed Type", {"GROUP_ID"}, {{"Data", each ModifyPartition(_), type table}}),
        #"Combined Partitions" = Table.Combine(#"Partitioned Groups"[Data])
    in
        #"Combined Partitions"
    There are multiple ways you can format your output, but I'd suggest loading to the data model, then using pivot tables.

    See attached worked example.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need a formula to determine priority based on rank
    By Nlambert in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-30-2017, 06:01 AM
  2. How to rank while comparing 2 cells
    By yusriza in forum Excel General
    Replies: 3
    Last Post: 03-23-2015, 03:46 PM
  3. [SOLVED] If statement that takes results from 2 columns to determine an outcome
    By jbeets in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-27-2014, 07:22 PM
  4. Comparing 2 different Excel Worksheets & obtaining desired outcome
    By rvkadu1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2013, 01:18 AM
  5. Replies: 1
    Last Post: 10-07-2011, 10:26 AM
  6. [SOLVED] Evaluating Rank to determine formula
    By Mary in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-10-2005, 12:33 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