Forum Discussion

GJG's avatar
GJG
Copper Contributor
Aug 08, 2018

Return lookup value only if meeting 3 criteria based on values

I have a spreadsheet with 2 worksheets and need to transfer data from one of them to the other based on multiple conditions.  The worksheets are formatted differently so I cannot just match rows and columns based on values.  

 

I've created a dummy spreadsheet showing how they are set up to explain what I need.  The actual list is over 1000 names long so transferring values manually would take days.  My two worksheets are TAB1 and TAB 2.  Below is what they look like in my dummy woorkbook:

TAB1

TAB2

Basically, I want the cell highlighted in yellow in TAB1 to retrieve the same information in TAB2 also highlighted in yellow.  Using the same principle, I want the retrieve orange to orange, red to red, etc.  Note that in the actual spreadsheet the names are not in the same order between the two tabs.  

 

I want to be sure there is a match between the ID number, the score (1, 2 or 3 as labeled), and whether the value is current or past (columns D,E,F in TAB1 and column G in TAB2).  

 

In other words: if the ID No. (TAB1 A3) matches an ID number anywhere in TAB2 A:A, and is listed as "CURRENT" in TAB2 G:G, and is in the row listed as "Score 1" TAB2  which contains the ID number, I want the formula in TAB1 D3 to retreive the value from TAB2 F:F.  If the ID No. matches but not the other conditions do I want this to remain blank.  

 

Similarly, I want the same set of criteria to return the Score 3 (TAB2 D:D) value to TAB1 F:F. 

 

The same formula would the repeat in TAB1 columns G,H,I except with the condition being a match with "PAST" in TAB2 G:G rather than "CURRENT".  

 

 

Is there a way to do this with some kind of INDEX MATCH formula?  Or a some kind of If/Then condition for LOOKUP?  

  • Philip West's avatar
    Philip West
    Steel Contributor

    You can use an index match, you need to construct it like this:

    Index([result],match(1,(condition 1)*(Condition 2)*(condition 3),0))

     

    Put the whole thing in an iferror to leave the cell blank if nothing is found.

     

    I've attached a quick spreadsheet with it working, hopefully that gets you to what you need.

Resources