Andy Latham
Andy Latham

Reputation: 41

vlookup pulling values from other rows

I have a vlookup pulling data from a second sheet and I don't know what I is wrong. the majority of data is getting pulled over correctly, but in a few cases, they are not.

I am using two Vlookups - one to pull from the 7th column in the range and one to pull from the 12th column in the range to give me my units of measurement and my cost respectively. my formulas are below:

=IF(A8="","",VLOOKUP(A8,'Revel Export'!$B$2:$N$50000,7)) //this to show me my UOM for what is found in cell A8

=IF($A8="","",VLOOKUP($A8,'Revel Export'!$B$2:$N$50000,12)) //this to show me my cost for what is found in cell A8

$A8 does change for each cell going up and down as it should so it goes from $A5 to $A14 in both column C & D.

please see my attached screenshots. you will note the following:

"8oz RB - Yellow Edition - 4PK6" is displaying the correct information for itself.

"Egg Scramble Liquid Fresh WHLFCLS" is displaying the information for "E.T. Vegan Raspberry Danish" (5 rows below requested data)

"E.T. Vegan Raspberry Danish" is displaying the correct information for itself.

"E.T. Vegan Cinnamon Roll" is displaying the information for "Dressing Mix Ranch Orig HVR" (5 rows above requested data)

"Wild Turkey 81" is displaying the correct information for itself.

I can set wild turkey to each row and it will pull the same correct data across each row, and I can set egg scramble to each row and it will pull the same wrong data across each row. I am at an utter loss!

enter image description here enter image description here enter image description here

enter image description here

Upvotes: 0

Views: 506

Answers (1)

basic
basic

Reputation: 11968

The VLOOKUP function has four parameters, the fourth has a value of TRUE / FALSE, by default TRUE, which means that a approximate value is searched for. Enter FALSE and everything will be fine.

=IF(A8="","",VLOOKUP(A8,'Revel Export'!$B$2:$N$50000,7,FALSE)) 

Upvotes: 1

Related Questions