HLOOKUP Question

trainer75

New Member
Joined
Jun 11, 2015
Messages
33
Hi,

Hope some one can assist me with this.

I am trying to do a HLOOKUP from data like below

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]13/14 P13W3[/TD]
[TD]13/14 P13W4[/TD]
[TD]14/15 P1W1[/TD]
[TD]14/15 P1W2[/TD]
[/TR]
[TR]
[TD]Bread[/TD]
[TD]46[/TD]
[TD]55[/TD]
[TD]54[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]Rolls[/TD]
[TD]28[/TD]
[TD]22[/TD]
[TD]42[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Butter[/TD]
[TD]66[/TD]
[TD]57[/TD]
[TD]58[/TD]
[TD]69[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

On another tab I have a drop down box to select the period/week and I then want it to bring back the data related to the date and the item (like below)

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]14/15 P1W1[/TD]
[/TR]
[TR]
[TD]Bread[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]Rolls[/TD]
[TD]42[/TD]
[/TR]
[TR]
[TD]Butter[/TD]
[TD]58[/TD]
[/TR]
</tbody>[/TABLE]

What I have as a formula but keep getting #Ref!

=IF(ISNA(VLOOKUP($B$1,INDIRECT($A1&"!A:K"),11,0)=TRUE),0,VLOOKUP($B$1,INDIRECT($A1&"!A:K"),11,0))

B1 is selecting the Date and the items are in column A from row 21 to 25

Hope this makes sense

Thanks in advance
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
what about an index/match solution?


Excel 2012
ABCDE
113/14 P13W313/14 P13W414/15 P1W114/15 P1W2
2Bread46555433
3Rolls28224212
4Butter66575869
5
614/15 P1W1
7Bread54
8Rolls42
9Butter58
Sheet1
Cell Formulas
RangeFormula
B7=INDEX($B$2:$E$4,MATCH($A7,$A$2:$A$4,0),MATCH(B$6,$B$1:$E$1,0))
 
Upvote 0
what about an index/match solution?

Excel 2012
ABCDE
13/14 P13W313/14 P13W414/15 P1W114/15 P1W2
Bread
Rolls
Butter
14/15 P1W1
Bread
Rolls
Butter

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]46[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]33[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]28[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]12[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]66[/TD]
[TD="align: right"]57[/TD]
[TD="align: right"]58[/TD]
[TD="align: right"]69[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="bgcolor: #E2EFDA, align: right"]54[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="bgcolor: #E2EFDA, align: right"]42[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="bgcolor: #E2EFDA, align: right"]58[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B7[/TH]
[TD="align: left"]=INDEX($B$2:$E$4,MATCH($A7,$A$2:$A$4,0),MATCH(B$6,$B$1:$E$1,0))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




That is superb,

Thank you very much for your quick reply.

I hadn't thought of index and match.

Thanks again :-)
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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