Lookup Help needed

damian_r_Home

Board Regular
Joined
Jan 8, 2005
Messages
231
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Morning all.

Some lookup (I think that’s the function this will be anyway) help needed as follows.

I need a formula in cell I2 that looks at a date in Cell F2, compares that to a range of dates in cells A12 to A350, finds the closest date in that range to within + or – 2 days (it might even be the exact same date) and then displays a value from the same row as the closet date but is over in column C.

Hope this makes some sense.

Best regards

D
 

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.
What should happen in this circumstance?
F2: 12 October 2018
Column A does not include 12 October 2018 but does include 11 October 2018 and 13 October 2018, both of which are equal closest to 12 October 2018.


.. finds the closest date in that range to within + or – 2 days ...
If there is no date within + or - 2 days of the given date, what should happen? .. or is that not possible with your data?
 
Last edited:
Upvote 0
Hi Peter,

Thanks for taking the time to reply.

As for two dates being equal closest to the base search date, I guess I'd prefer it to the higher date that is used.

Good question as to what should happen if there is not a date with the +/-2 days - for now i think it just needs to return a text value of N/A.

Many thanks

Damian
 
Upvote 0
Are the dates in column A sorted earliest to latest, latest to earliest, not sorted?
 
Upvote 0
See if this would work for you.
H2: =AGGREGATE(15,4,ABS($A$12:$A$350-F2),1)
I2: =IF($H$2>2,"N/A",IFERROR(VLOOKUP(F2+$H$2,$A$12:$C$350,3,0),VLOOKUP(F2-$H$2,$A$12:$C$350,3,0)))
 
Last edited:
Upvote 0
Wow....I'd never have got anywhere near that formula!!

I'll try it in a bit.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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