LOOKUP CRITERIA

ovadeso

Board Regular
Joined
Sep 23, 2004
Messages
150
Hey guys, I have a question on the VLOOKUP and HLOOKUP functions. Basically i would like to know if you can combine both in the same formula. Lets say you have a table with the heading being the months from Jan. to Dec. and the 1st column being the years from 1996 to 2004, and you want to return a value from that table for a specific month and year based on a date that you entered in a separate sheet, how is that done? I know i can do a VLOOKUP and find the year and then specify a column # from which i want the value returned. But what if i don't want to specify a column # and want excel to look for the value under the month shown in the date? Is this possible?
Thanks for your suggestions.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Book1.xls
ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDec
21996123.0456.0789.01122.01455.01788.02121.02454.02787.03120.03453.03786.0
31997135.3501.6867.91234.21600.51966.82333.12699.43065.73432.03798.34164.6
41998148.8551.8954.71357.61760.62163.52566.42969.33372.33775.24178.14581.1
51999163.7606.91050.21493.41936.62379.82823.13266.33709.54152.74595.95039.2
62000180.1667.61155.21642.72130.32617.83105.43592.94080.44568.05055.55543.1
72001198.1734.41270.71807.02343.32879.63415.93952.24488.55024.85561.16097.4
82002217.9807.81397.81987.72577.63167.63757.54347.44937.35527.36117.26707.1
92003239.7888.61537.52186.52835.43484.34133.24782.25431.16080.06728.97377.8
102004263.7977.51691.32405.13118.93832.74546.65260.45974.26688.07401.88115.6
11
121999
13Mar
141050.21050.2
Sheet6


The formulas are:

A14:=INDEX(A1:M10,MATCH(A12,A1:A10,0),MATCH(A13,A1:M1,0))

B14:=VLOOKUP(A12,A1:M10,MATCH(A13,A1:M1,0),0)
 
Upvote 0
Thanks a million, I haven't tried it yet but you,ve duplicated my situation excatly, except for the date format. I take it that i'll need to have the month and year in separate cells. The format Dec 2000 or 12/2000 in one cell would not work. If thats the case i'll simply split the date up into different cells. Thanks again.
 
Upvote 0
Book1.xls
ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDec
21996123.0456.0789.01122.01455.01788.02121.02454.02787.03120.03453.03786.0
31997135.3501.6867.91234.21600.51966.82333.12699.43065.73432.03798.34164.6
41998148.8551.8954.71357.61760.62163.52566.42969.33372.33775.24178.14581.1
51999163.7606.91050.21493.41936.62379.82823.13266.33709.54152.74595.95039.2
62000180.1667.61155.21642.72130.32617.83105.43592.94080.44568.05055.55543.1
72001198.1734.41270.71807.02343.32879.63415.93952.24488.55024.85561.16097.4
82002217.9807.81397.81987.72577.63167.63757.54347.44937.35527.36117.26707.1
92003239.7888.61537.52186.52835.43484.34133.24782.25431.16080.06728.97377.8
102004263.7977.51691.32405.13118.93832.74546.65260.45974.26688.07401.88115.6
11
1219993/1/1999
13Mar
141050.21050.21050.2
Sheet6


Here you go --

=VLOOKUP(YEAR(C12),A1:M10,MATCH(TEXT(C12,"mmm"),A1:M1,0),0)
 
Upvote 0

Forum statistics

Threads
1,203,605
Messages
6,056,234
Members
444,852
Latest member
MJaspering

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