+ Reply to Thread
Results 1 to 5 of 5

Nested Index Match in Power Query

  1. #1
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Nested Index Match in Power Query

    hi,

    do you know how to perform nested Index Match in Power Query?

    Start looking in 1st column, then narrow looking in 2nd column, and then give a result from the 3th column. For example 11 gives aaa and 4B gives fff.

    One more thing, can I make it without merging columns 1 and 2?

    No Index Description
    1 1 aaa
    1 2 bbb
    2 R ccc
    3 1 ddd
    4 A eee
    4 B fff

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Nested Index Match in Power Query

    Here...

    Replace 1& 1 with reference cells (ie E1&F1)

    =INDEX($C$5:$C$22,MATCH(1&1,$A$5:$A$22&$B$5:$B$22,0))

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Nested Index Match in Power Query

    note that better approach is with some delimiter like for example |

    =INDEX($C$5:$C$22,MATCH(E1&"|"&F1,$A$5:$A$22&"|"&$B$5:$B$22,0))

    Previous solution will fail if you have overlapping criteria.

    For example: 1 & 11 and 11 & 1 will give wrong result in first approach, and good result in second.

  4. #4
    Forum Contributor
    Join Date
    09-13-2010
    Location
    Poland
    MS-Off Ver
    365
    Posts
    204

    Re: Nested Index Match in Power Query

    Quote Originally Posted by zbor View Post
    note that better approach is with some delimiter like for example |

    =INDEX($C$5:$C$22,MATCH(E1&"|"&F1,$A$5:$A$22&"|"&$B$5:$B$22,0))

    Previous solution will fail if you have overlapping criteria.

    For example: 1 & 11 and 11 & 1 will give wrong result in first approach, and good result in second.
    hi, Ia m looking for a Power Query solution.

  5. #5
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: Nested Index Match in Power Query

    Create a blank query and paste this function in the editor
    Call this function "fnFind". Afterwards you can invoke this function

    PS: Make sure you format your columns as TEXT

    PHP Code: 
    (tbl as tableNo as textind as text) =>

    let
        f1 
    Table.SelectRows(tbleach [No] = No),
        
    f2 Table.SelectRows(f1each [Index] = ind)
    in
        f2
    [Description]{0
    Last edited by JEC.; 02-22-2024 at 02:05 PM.

+ 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. Power Query Add index number to existing column
    By Dicken in forum Office 365
    Replies: 5
    Last Post: 01-10-2024, 09:31 AM
  2. [SOLVED] Power Query nested if evaluation order
    By Dicken in forum Office 365
    Replies: 5
    Last Post: 01-02-2024, 09:32 AM
  3. Use Row/Index number as Variable in Power Query
    By ptmuldoon in forum Office 365
    Replies: 3
    Last Post: 11-06-2023, 06:03 PM
  4. Replies: 1
    Last Post: 07-14-2023, 10:15 AM
  5. Power query positional index operator for column
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 11-04-2021, 12:11 PM
  6. [SOLVED] INDEX & MATCH not working through a power query
    By DvDj in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-03-2020, 06:27 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 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