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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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:

[TABLE="width: 201"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]Pay[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD] AB06A [/TD]
[TD="align: right"]6,403.42[/TD]
[TD="align: right"]Sep-17[/TD]
[/TR]
[TR]
[TD] AB06A [/TD]
[TD="align: right"]6,404.42[/TD]
[TD="align: right"]Oct-17[/TD]
[/TR]
[TR]
[TD] AB06A [/TD]
[TD="align: right"]6,405.42[/TD]
[TD="align: right"]Nov-17[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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