Vlookup to return value below Search Value

ridimo

New Member
Joined
Nov 13, 2013
Messages
8
Hi Guys
So very new to this so please excuse my horrible Excel Grammer. I'm hoping the masters here can help me on this weird 1 bee searching for a while but couldnt find the answer.

I have 2 Worksheets that i am working off.

Worksheet 1 has a list of employee codes

Employee CodeName
001Peter
002John
003Paul

<TBODY>
</TBODY>

Worksheet 2 is a report generated from the Payroll Program.


LeaveOpeningDaysDaysDays
CodeBalanceAccruedTakenDue
001Peter
Annual Leave1310.5158.5
002John
Annual Leave1710.51215.5
003Paul
Annual Leave77.5113.5

<TBODY>
</TBODY>

Essentially I can need to be able to get a formula that will extract the Days due value for each employee by using the employee code
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try something like:

Code:
=INDEX(RangeOfInterest,MATCH(EmployeeCode,EmployeeCodeRange,0)+1)

Matty
 
Upvote 0
Hi Matty
any chance i could ask how to work this formula? as in a dummy guide coz i never worked with index before
 
Upvote 0
From a google search.

Matty provided the 1 row offset to suit your need.

Rich (BB code):
 Here’s how I think about the formula as I’m typing it in: 

=INDEX ( Column I want a return value from , MATCH ( My Lookup Value , Column I want to Lookup against , Enter “0″ )) 

- See more at: How to Use INDEX MATCH

Regard,
Howard
 
Upvote 0
Hi Matty
any chance i could ask how to work this formula? as in a dummy guide coz i never worked with index before

Hi,

Whenever I don't understand what a function does, the help files are always my first port of call. That said, to briefly explain what this formula is doing...

The INDEX part captures all of the values in range referenced, which in this case is the Days Due column. INDEX will therefore hold the following values:

{0;8.5;0;0;15.5;0;0;13.5}

The MATCH part of the formula is looking for the Employee Code being looked up within the range where all employee codes exist, and will return its numerical position within that range. So, for example, if we were referencing employee 002, then MATCH would return 4 from the following values:

{"001";0;0;"002";0;0;"003";0}

Because your Days Due data is offset by one row from where the employee codes are held (i.e. Code), we have to add 1 to what MATCH returns, so we get 5. This is passed to INDEX which then returns the 5th value in its range, meaning 15.5 comes back.

Hope this helps. And welcome to MrExcel, btw! (I forgot to put this in my last post!)

Matty
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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