Formula to see if a date falls between a certain period

Sundance_Kid

Board Regular
Joined
Sep 2, 2017
Messages
155
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have data with a list of dates spanning 10 years.

I want to do a lookup to determine which category does the date fall under.

So I will have a table to lookup into like this

01/04/2010 - 31/03/2011 - Year 1
01/04/2011 - 31/03/2012 - Year 2

and so on, it will bring me up to Year 10 I think.

If I have a date, lets say 25/03/2012, I want the lookup to return Year 2. Also, if the date was either 01/04/2012 or 31/03/2012 I would also like it to return Year 2, so the date is between or on the two dates.

Is there a quick formula to use considering there will be around 10 potential 1 year periods a date may fall into.

Thank you
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How about
Fluff.xlsm
ABC
1
201/04/201031/03/2011Year 1
301/04/201131/03/2012Year 2
4
5
6
723/03/2011Year 1
Data
Cell Formulas
RangeFormula
B7B7=XLOOKUP(A7,A2:A3,C2:C3,"",-1)
 
Upvote 0
Hey, thank you for your reply.

But the Microsoft Office I am using does not currently have the xlookup option :(
 
Upvote 0
In that case how about
Excel Formula:
=VLOOKUP(A7,A2:C3,3,1)

Thank you that worked.

How does it work if the lookup value (the date) is not evident in the table array? Is excel clever enough to look between a range of dates to decide which value to pull? Is it something to do with the 1 (approx match) at the end of the formula rather than it being a 0 (exact match) ?
 
Upvote 0
The approx match will find the exact value or next smallest.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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