Range Lookup

keiserj

Board Regular
Joined
May 31, 2013
Messages
89
Currently have a tab that is called MYYEAR which includes the following table.



MY10
7/1/2009​
6/30/2010​
MY11
7/1/2010​
6/30/2011​
MY12
7/1/2011​
6/30/2012​
MY13
7/1/2012​
6/30/2013​
MY14
7/1/2013​
6/30/2014​
MY15
7/1/2014​
6/30/2015​
MY16
7/1/2015​
6/30/2016​
MY17
7/1/2016​
6/30/2017​
MY18
7/1/2017​
6/30/2018​
MY19
7/1/2018​
6/30/2019​
MY20
7/1/2019​
6/30/2020​

Then a first tab that has data that I would like to look at the dates in column "D" and return in column E the corresponding model year. Currently using the following formula which I can get to work in same tab has MYYEAR but not when reference second tab.

=LOOKUP(2,1/(MYYEAR!$C$3:$C$13<=B2)/(MYYEAR!$D$3:$D$13>=B2),MYYEAR!$B$3:$B$13)

I have checked cell formats to be dates and even moved to same tab but getting NA.

Not sure what I'm doing wrong.

Thanks!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I have checked cell formats to be dates and even moved to same tab but getting NA.
Are they actual dates though?

A text string formatted as date is still a text string. If you change the format to number do you still see dates, or do you see numbers in the range of 40000 to 45000 (approx)?
 
Upvote 0
Are they actual dates though?

A text string formatted as date is still a text string. If you change the format to number do you still see dates, or do you see numbers in the range of 40000 to 45000 (approx)?


thanks for you information I found that the format from the export is not coming across correctly. If i edit each cell then my formula works.

12/30/2010​
MY11
1/14/2011​
MY11
12/29/2010MY20

Any way to change this in the mass vs. each cell have 8000+ rows
 
Upvote 0
Try selecting the column, format as date or general, then use text to columns to make them valid.

Data tab > Text to columns > Next > Uncheck all boxes > Next > Select your correct date format from the dropdown > Finish.

This should work as long as there are no hidden characters which you can sometimes get with imported data.
 
Upvote 0
Try selecting the column, format as date or general, then use text to columns to make them valid.

Data tab > Text to columns > Next > Uncheck all boxes > Next > Select your correct date format from the dropdown > Finish.

This should work as long as there are no hidden characters which you can sometimes get with imported data.

Thanks! Thats just what I needed!
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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