Lookup a value if the dates fall between two dates

user3084662 picture user3084662 · Mar 6, 2014 · Viewed 89.4k times · Source

I have window dates in two cells. For example:

  • a1 = 1/1/2014 8:00
  • b1 = 1/4/2014 10:00
  • c1 = 11

Where

  • A is the start date
  • B is the end date
  • C is the code for the window

In cell d1 I have the date: 1/3/2014 7:00

I would like to look up the date in a/b and if d falls between those dates then I would like for it to return the code for the window.

Answer

barry houdini picture barry houdini · Mar 6, 2014

Assuming you have multiple "windows" listed in order with no gaps perhaps try LOOKUP like

=LOOKUP(D1,A1:C10)

see example