Formula to see if a date is before, during or after a specific date range

sammy2xx

New Member
Joined
May 18, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to see if a date is before, during or after a specific date range.

For example:

A1 16/01/2020

A2 01/01/19 B2 31/12/19
A3 01/01/20 B3 31/12/20
A4 01/01/21 B3 31/12/21

I need a formula for C2,C3 and C4 to see if the date in A1 is before, during or after each range.

So in this instance C2 = Before, C3 = During, C4 = After
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Welcome to the forum!

Try:

Book1
ABC
11/16/2020
21/1/201912/31/2019After
31/1/202012/31/2020During
41/1/202112/31/2021Before
Sheet28
Cell Formulas
RangeFormula
C2:C4C2=IF(A$1<A2,"Before",IF(A$1>B2,"After","During"))


I think you might have reversed the "Before" and "After" in your example, since 1/16/2020 (January 16, 2020) is after the first range. If you want it the other way, swap the "After" and "Before" values in the formula.
 
Upvote 0
Try this in C2 and copy down.

=IF(AND($A$1>A2, $A$1<B2),"During",IF($A$1>B2,"After","Before"))
 
Upvote 0
If your date ranges are always whole years, another option
+Fluff New.xlsm
ABC
116/01/2020
201/01/201931/12/2019After
301/01/202031/12/2020During
401/01/202131/12/2021Before
List
Cell Formulas
RangeFormula
C2:C4C2=CHOOSE(SIGN(YEAR(A$1)-YEAR(A2))+2,"Before","During","After")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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