Multiple VLOOKUP stump

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
719
Office Version
  1. 2010
Platform
  1. Windows
Hi:

Could you tell me why this formula is returning ""

=IF('LReports'!J3="UG",VLOOKUP(H3,'AVERAGE Price'!$B$5:$D$39,3,0),IF(J3="DF",VLOOKUP('LReports'!H3,'AVERAGE Price'!$B$5:$D$39,2,0),""))

VLOOKUP range looks something like this:

column B column C column D
MMYY DF UG
917 1.8954 1.7754
1017 1.8804 1.6722
1117 1.9728 1.7295

values in J are "DF", "UG" and No code

values in H: 917, 1017, 1117...


Thanks for your help.

Sean
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
What's the value in J3 on 'LReports' and the value in J3 on the sheet the formula is in?
 
Upvote 0
HI:

Formula is in Q3 of 'LReports'

value in J3 = No code

Regards
 
Upvote 0
HI:

Formula is in Q3 of 'LReports'

value in J3 = No code

Regards

That's the reason you are getting " ".

As per your code, it would return value from column D if J3 = "DF" ; from column C if J3 = "UG" and " " if J3 has another value
 
Upvote 0
I was expecting "" for values in J3 other than "DF" and "UG" but formula is returning "" for all values in column J.

I don't understand why? Cold you revise formula?
 
Last edited:
Upvote 0
=IF('LReports'!J3="UG",VLOOKUP(H3,'AVERAGE Price'!$B$5:$D$39,3,0),IF(J3="DF",VLOOKUP('LReports'!H3,'AVERAGE Price'!$B$5:$D$39,2,0),""))


In K3 of LReports enter:

=IFERROR(VLOOKUP(H3,
'AVERAGE Price'!$B$5:$D$39,VLOOKUP(J3,{"DF",2;"UG",3},2,0),0),"")
<strike>
</strike>
 
Upvote 0
@Aladin Akyurek: formula is returning "" for all values.

In VLOOKUP(J3,{"DF",2;"UG",3},2,0),0),""):

where is excel looking up "DF" & UG"

What is 2,0 doing?

Just trying to understand all this.

Average price is on separate worksheet.

All other lookup information is on another worksheet.

Sean
 
Last edited:
Upvote 0
The

VLOOKUP(J3,{"DF",2;"UG",3},2,0)

bit is looking up J3 in the had-coded table, which is exactly the same as:

DF, 2
UG, 3

What does

=VLOOKUP(H3,'AVERAGE Price'!$B$5:$D$39,VLOOKUP(J3,{"DF",2;"UG",3},2,0),0)

return?

 
Last edited:
Upvote 0
Here is sample:


Excel 2010
HIJKL
310152017/10No price required value
410172017/10UG1.3845required value
510172017/10DF  should be 1.4551
610162016/10UG  should be 1.2731
704162016/04DF  should be 1.0566
810152016/10UG1.4875required value
910172017/10DF  should be 1.4551
LReport
Cell Formulas
RangeFormula
K3=IFERROR(VLOOKUP(H3,pricing!$B$5:$D$9,VLOOKUP(J3,{"DF",2;"UG",3},2,0),0),"")
K4=IFERROR(VLOOKUP(H4,pricing!$B$5:$D$9,VLOOKUP(J4,{"DF",2;"UG",3},2,0),0),"")
K5=IFERROR(VLOOKUP(H5,pricing!$B$5:$D$9,VLOOKUP(J5,{"DF",2;"UG",3},2,0),0),"")
K6=IFERROR(VLOOKUP(H6,pricing!$B$5:$D$9,VLOOKUP(J6,{"DF",2;"UG",3},2,0),0),"")
K7=IFERROR(VLOOKUP(H7,pricing!$B$5:$D$9,VLOOKUP(J7,{"DF",2;"UG",3},2,0),0),"")
K8=IFERROR(VLOOKUP(H8,pricing!$B$5:$D$9,VLOOKUP(J8,{"DF",2;"UG",3},2,0),0),"")
K9=IFERROR(VLOOKUP(H9,pricing!$B$5:$D$9,VLOOKUP(J9,{"DF",2;"UG",3},2,0),0),"")




Excel 2010
BCD
5MMYYDFUG
610151.53811.4875
710171.45511.3845
810161.20981.2731
904161.05661.1080
pricing



Regards,
 
Upvote 0
The DF entries in LReport has trailing spaces.

Either remove those spaces or invoke:

=IFERROR(VLOOKUP(H3,pricing!$B$5:$D$9,VLOOKUP(TRIM(J3),$P$3:$Q$4,2,0),0),"")
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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