This is my first post to your forum, I was wondering how to generate a list of ten dates: the past 5 Saturdays and the next 5 Saturdays, based on whatever the current date is. I appreciate any assistance you can provide.
This is my first post to your forum, I was wondering how to generate a list of ten dates: the past 5 Saturdays and the next 5 Saturdays, based on whatever the current date is. I appreciate any assistance you can provide.
Welcome to the forum.
The today function will give today's date. The weekday function will return the day of the week, I will use weekday(today(),16) to return day of the week as numbers 1 (Saturday) to 7 (Friday).
You should be able to combine these to get the last Saturday as follows:
Formula:
Please Login or Register to view this content.
(this will give today's date if today is a Saturday)
You can then add or subtract as many sets of 7 days as you like to find future or past Saturdays.
I.e. Assuming above formula is in cell A1, next Saturday is calculated as:
Formula:
Please Login or Register to view this content.
Hope this helps (and works!)
Hi Tom and welcome to the forum,
Alex above gave a great answer except, why 16? See http://www.excelfunctions.net/Weekday-Function.html to see the reason.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
The 16 worked, not sure why, but I am a happy camper! thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks