Problem with Dates

Ralph M

Well-known Member
Joined
Apr 16, 2002
Messages
502
Office Version
  1. 2016
Platform
  1. Windows
I have a WorkSheet with a schedule on it and I am working with dates and formulas as the dates will change every year (the user type the year in cell "C1"), I have a special event that occurs on Sunday after Christmas but before January 1st. If there is no Sunday before Jan 1st, then December 30th. Can someone help me with the formula?
Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Not sure if this is what you want, but here goes...

=IF(WEEKDAY(Q14)>1,Q14+(8-WEEKDAY(Q14)),Q14+5)

Basically, if Christmas falls on any other day than Sunday, there will be another Sunday in December.
So if the day of the week is > 1 (Sunday) add 8 minus the day of the week to Christmas day.
Otherwise, just add 5 days to get to December 30th.

K
 
Upvote 0
Check the weekday function to test what day 12/25/2004 is and go from there.
 
Upvote 0
Ralph M said:
I have a WorkSheet with a schedule on it and I am working with dates and formulas as the dates will change every year (the user type the year in cell "C1"), I have a special event that occurs on Sunday after Christmas but before January 1st. If there is no Sunday before Jan 1st, then December 30th. Can someone help me with the formula?
Thanks

That would be December 26, 2004. What are you trying to do, besides flag the Sunday after Christmas? What formulas are you using now?
 
Upvote 0
how about something like this?....
Book14
ABCD
1YearSundayBefore
2200312/28/2003
Sheet2


HTH

edit: wow! i was a little slow on that one (reminder to self - refresh before post :oops: )
 
Upvote 0
Thanks to all, got it.

I have one more (I think). I need to find the 1st Sunday after January 6th. I've been trying to figure out the formula on my own, to no avail.
The year would be in cell "C1". Thanks for any help.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

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