HLookup Unexpected Value

Eb0la11

Board Regular
Joined
Apr 2, 2007
Messages
56
Office Version
  1. 365
I am doing a simple Hlookup with dates at the top of my array. My lookup compares dates but looks at only the month and year then compares only the month and year of the dates at the top of my table. Then I am returning the 3rd row of my 3 row table.

Here is my formula:
=HLOOKUP(MONTH(F3)&YEAR(F3),MONTH('2017 JOB NUMBER LOG'!T1:AO3)&YEAR('2017 JOB NUMBER LOG'!T1:AO3),3,FALSE)

Does this need to be an array formula? Its giving me an error else wise.

Also it returns a number that isn't even anywhere in the array.

The exact cell I expect it to pull the value from is a cell that has a formula in it. When HLookup returns this cell is it by chance returning the formula or does it always return whatever is in the cell as a result? The number in the cell for example is $781,460 but it is returning 24406.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try:

=INDEX('2017 JOB NUMBER LOG'!T3:AO3,MATCH(MONTH(F3)&"|"&YEAR(F3),MONTH('2017 JOB NUMBER LOG'!T1:AO1)&"|"&YEAR('2017 JOB NUMBER LOG'!T1:AO1),0))

confirmed with Control+Shift+Enter.
 
Upvote 0
1st, a formula will return what is displayed by the cell, not the underlying contents - ie, it will show the value in the cell, notthe formula in the cell.

2nd, What you need to understand about dates and times in excel is…

a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Sun 24 Sep 2017) is actually 43002

Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

Having said that, if all you want if the month/year, it might be simpler to us a helper row to pull just that "value", then base the hlookup on that helper row
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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