IF OR VLOOK

New Contributor

Good morning, your feedback is greatly appreciated.

 

What will be the best function to obtain the following result:

I have the following columns - A, B, C and D

A and C have SS numbers in different order and different number of records.

B has the employee ID matching column C

I need D to tell me what Employee ID belongs to A.

Is this possible?

 

Thank you,

5 Replies

@LidiaMunoz 

In D2

=XLOOKUP(A2, $B$2:$B$1000, $C$2:$C$1000, "")

If you don't have Microsoft 365 or Office 2021:

=IFERROR(VLOOKUP(A2, $B$2:$C$1000, 2, FALSE), ")

Adjust the ranges if necessary, then fill down.

Thank you Hans, it did not work

@LidiaMunoz 

Could you attach a sample workbook (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Thanks in advance.

@Hans Vogelaar 

Below is a sample of my data:

Column A SS (Need to find Employee ID)

a2 - 9958447

Column B E-ID

b2 - 795627

b3 - 589672

b4 - 689256

 

Column C - SS

c2 - 9958447

c3 - 4885716

c4 - 6789255

 

I need to narrow down which E-ID belongs to A2.

 

Thank you for your time.

@LidiaMunoz 

Thanks, I switched B and C.

In Microsoft 365 and Office 2021:

=XLOOKUP(A2, $C$2:$C$1000, $B$2:$B$1000, "")

In older versions:

=IFERROR(INDEX($B$2:$B$1000,MATCH(A2,$C$2:$C$1000,0)),"")