Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Assess Date

Hi,

I need some formula to work out whether a data is this week or last week

So if date Serial is within last 7 days "this week"

if date serial is between 7-14 days old, last week

Maybe theres a smarter way?

Basically i have a string of dates and im trying to work out whether its this week or last week

Thanks
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

It could also depend on if you interpret a week by the days, rather than the dates.  Your algorithm above certainly works in terms of aging:  Current Date minus Date Serial ... if <= 7 then "This Week"; if > 7 and <= 14 then "Last Week").

But, if you're looking at a Sunday - Saturday calendar, and the current Day is a Sunday, then any value <=7 is "Last Week".  And that formula would change if you were on a Monday - Sunday calendar.

Do you need a formula in Excel or VBA?

-Glenn
Avatar of Seamus2626

ASKER

I would prefer formula GlenN, but can work fine with VBA....

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Glenn!
You're welcome.