Formula to check if one date is within a range of other dates?

kellyfirth

New Member
Joined
Nov 26, 2014
Messages
15
Sorry if I don't explain this very well, I'll do my best-

I need a formula in B1, which will check the date in A1 and tell me if it is within this week's dates. It will say 'This Week' if this is true. (eg. if A1 says: '30/12/2014' (or any other date from the current week) then it will say 'This Week')

However if the date in A1 is NOT within this week's dates, I need it to check whether it is within last week's dates. If this is true, it will say 'Last Week.' (eg. if A1 says: '25/12/2014' (or any other date from the previous week) then it will say 'Last Week')

If before last week's dates then it will say, 'Over 2 weeks ago.'

I understand this is a little difficult and I'm struggling to wrap my head around it myself. I think I'm able to write this by manually putting in the dates myself, but ideally, I'd like these to just populate everytime the date changes so that I don't have to change them each week if possible.

Let me know if you need any other information and apologies for my lack of clarity!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,

Assuming your weeks start on a Sunday, this formula should do it:

=LOOKUP(TODAY()-WEEKDAY(TODAY(),2)-A1,{-6,1,8},{"This Week","Last Week","Over 2 weeks ago"})


It will return #N/A if the date in A1 is in the future ahead of the current week.
 
Upvote 0
Sorry if it's a bit cheeky to ask, is it possible to make this work for months too?
So it could say: This Month, Last Month, Over 2 months ago?
 
Upvote 0
Try:

=LOOKUP(DATEDIF(A1,EOMONTH(TODAY(),0),"m"),{0,1,2},{"Current month","Last month","2 Months ago or more"})

It will return #NUM! if the date in A1 is ahead of the current month.
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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