V Lookup not reading the correct data (skips the row and doesn't match)

pedexe90

Board Regular
Joined
Apr 18, 2018
Messages
59
Hello everyone,

So I thought I would try to share this problem with you, this forum has been very helpful to me.

So I have a worksheet of data with names and salaries for each month (I have reduced the number of months for this purpose). I am building a separate worksheet to analyse those names against there monthly salaries. I have included a copy of the spreadsheet in this OneDrive link ([url]https://1drv.ms/x/s!AgQdYsSdg735crYwBr016fE5WlU)[/URL]

So on the first column I am using an index formula to extract all unique names from the stacked up column as employees might join and leave from month to month. Next, I am using the VLookup to match names and month and extract corresponding salaries.

This works fine until the VLookup finds a name that is not matching in that particular month (someone left or joined) and just populates the cell with the next name's value. (Highlighted)

I would be very grateful if someone could please help with this.

Many thanks.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Yeah you cant do what you are doing. You dont have your names lined up in the data so you are searching in the first month for your name then returning whatever is in the next few columns for that row regardless of the name for that particular month.
 
Upvote 0
Its a bit complicated because of how you have this set out but this could work:

=INDEX('PAYROLL_FT_SEPT17-MAY18'!$B$1:$I$1000,MATCH($A5,INDEX('PAYROLL_FT_SEPT17-MAY18'!$B$1:$I$1000,,MATCH(B$1,'PAYROLL_FT_SEPT17-MAY18'!$B$1:$I$1,0)-1),0),MATCH(B$1,'PAYROLL_FT_SEPT17-MAY18'!$B$1:$I$1,0))
 
Last edited:
Upvote 0
Well I think it did. Fantastic!!! Wish I could just look at a problem in excel and solve it like that.
 
Upvote 0
It gets easier the more you use it. Glad it worked out. You would probably be better storing your data 'flat' so the date becomes part of each line rather than tabular. It would be easier to work with such as:

NamePayDate
AB06A 6,403.42Sep-17
AB06A 6,404.42Oct-17
AB06A 6,405.42Nov-17

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,201
Messages
6,123,621
Members
449,109
Latest member
Sebas8956

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