• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

INDEX MATCH Function

puneetsod

New Member
Hi All,

I am looking for a solution to an excel problem.

I have data for sales representatives showing the different states they are selling products in, the different states are randomly sorted in rows, ie- Agent A is rendering services in New York Michigan and Utah, they are US Territory 1, 2 and 3 respectively, but for Agent 2 rendering services in California, New York and Montana they are US Territory 1, 2 and 3. I have different IDs for the agents so that is a unique reference. In my output sheet I have all the US states in alphabetical order I need the states for those states arranged in columns against those agents. I am currently able to do a INDEX MATCH and can bring in the US territories as in Terriotry 1 , 2 and 3 and they are randomly ordered for all agents, but i need them ordered in columns against the respective states i have in the column.
 

Attachments

  • RepHunter Contacts - Member #121577 (1)_New.xlsx
    27.6 KB · Views: 8
I am not sure that I understand. In the workbook you have an INDEX MATCH formula that lists US states AND overseas territories (Sheet 1) - is this where you want a new formula? And if it is, and you want the states to align with the states as listed in B and C (is this correct?), where should China et al be listed?
 
Yes please. need the states aligned to the states listed in col BI to DU in tab Rep Hunter to the states listed in Sheet 1 in Col B10 to B66

Some anomalies in the data shows China and overseas territory listed there which I need to ignore.

Thanks.
 
First, get rid of ALL of the INDEX MATCH formulae (they are clunky and slow). We'll use 365 functions instead.

Next, in D10 copied across:

Code:
=LET(d,TOCOL(FILTER('RepHunter Contacts - Member #12'!$BI2:.$DW5000,('RepHunter Contacts - Member #12'!$C2:.$C5000=D$2)),1),
BYROW($B$10:$B$66,LAMBDA(r,XLOOKUP(r,d,d,""))))
 

Attachments

  • puneetsod RepHunter Contacts - Member #121577 (1)_New(1) SPILL 365 AliGW.xlsx
    23.1 KB · Views: 2
Now that I understand what you want (thanks @AliGW !) there's another formula that you could use which also means you don't need the TEXTSPLIT in column BI of the first sheet. In D10:
Code:
=BYROW($B10:$B66,LAMBDA(a,IF(ISNUMBER(SEARCH(a,XLOOKUP(D2,'RepHunter Contacts - Member #12'!$C2:.$C$5000,'RepHunter Contacts - Member #12'!$BC2:.$BC5000))),a,"")))
copied across.
 
Back
Top