Need help please on query

Copper Contributor

i All,
In English, I want to populate the cell J4 based on the table value (see attached image)

If cell IA = WDDS the populate with table WDDS value 6:00
If cell IA = WDAS the populate with table WDAS value 12:00
If cell IA = WDNS the populate with table WDNS value 20:00
If cell IA = WEDS the populate with table WEDS value 8:00
If cell IA = WENS the populate with table WENS value 20:00
If cell IA = SAL the populate with table SAL value 8:00

 

Thanks in advance

4 Replies

@LanceP In J4, that could be:

 

=INDEX(E4:E9,MATCH(I4,F4:F9,0))

 

or

=XLOOKUP(I4,F4:F9,E4:E9,"",0)

if your Excel version supports XLOOKUP 

@LanceP 

This can be done by using INDEX MATCH function.

=INDEX(E4:E9,MATCH(I4,F4:F9,0))

 

Make sure you extend the data range in case more records are added. Hope this helps.

@ShishirKumar 

What's the difference with @Riny_van_Eekelen suggestion?

@Sergei Baklan 

Nothing. I just saw the XLOOKUP thing. Missed the above point.