Struggling with a specific VLOOKUP

jaxstraww

New Member
Joined
Nov 2, 2013
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
This VLOOKUP has two columns of data combined into one and I'm struggling with the formula to solve.

In column A I have Employee ID
In column B I have Hire Date
In column C I have a unique identifier
In column D I have Age
In column E I have separation column
In column F I have Age
In column G I have Hire Date + Employee ID

Looking to solve for Age in Column D
 

Attachments

  • Capture.PNG
    Capture.PNG
    10.5 KB · Views: 19

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Since you have 365, would this work for you:

Excel Formula:
=XLOOKUP(--(B2:B5&A2:A5),G2:G5,F2:F5)
 
Upvote 0
Hello - you could also try;

=IFERROR(INDEX($F$2:$F$5,MATCH("*"&B2&"*",$G$2:$G$5&"",0)),"")
 
Upvote 0
Hello - you could also try;

=IFERROR(INDEX($F$2:$F$5,MATCH("*"&B2&"*",$G$2:$G$5&"",0)),"")
Hey Nick, appreciate the formula but that looks way more advanced than I'm hoping. Also looking to be able to do this myself much like a standard VLOOKUP. The key is to solve with a VLOOKUP> Fine with an XLOOKUP I think if I can get it to work being they are close in name at least.
 
Upvote 0
For older version, try INDEX/MATCH.
Book1
ABCDEFG
1Emp IDHire DateIDAgeAgeHire Date + Emp ID
250551101202015050110120205055
340551101202024565110120203055
430551101202036545110120204055
520551101202142323110120212055
Sheet10
Cell Formulas
RangeFormula
D2:D5D2=INDEX($F$2:$F$5,MATCH(B2&A2,$G$2:$G$5,0))
 
Upvote 1
Solution
Ah no problem at all Jaxstraww - yes, no doubt there will be a way to solve this through using both Vlookup and Xlookup. I could have actually used the Vlookup with the match instead of Index with the match but within the match element of the formula, it looks complicated because we are extracting only part of the reference we are looking up, hence using "*"&B2&"*" and then using IFERROR at the start just in case you want a blank result in case of an error.

Take care.
 
Upvote 0
For older version, try INDEX/MATCH.
Book1
ABCDEFG
1Emp IDHire DateIDAgeAgeHire Date + Emp ID
250551101202015050110120205055
340551101202024565110120203055
430551101202036545110120204055
520551101202142323110120212055
Sheet10
Cell Formulas
RangeFormula
D2:D5D2=INDEX($F$2:$F$5,MATCH(B2&A2,$G$2:$G$5,0))

Appreciate the quick reply. Getting an error message. Checked the formula and all looks correct. Wonder if I have a formatting error someplace with the numbers. Using format "number" for columns B & G.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    13.1 KB · Views: 5
Upvote 0
Appreciate the quick reply. Getting an error message. Checked the formula and all looks correct. Wonder if I have a formatting error someplace with the numbers. Using format "number" for columns B & G.
Ignore my stupidity. I had to add an ' to column G. It was the scientific notation causing me grief.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top