Find day of the week next year

info overload

New Member
Joined
Nov 8, 2016
Messages
22
Hello all,

I am building a sheet where I am comparing sales to the same day of the week between years and account for leap year. So in the same row I need the Mondays to line up. "=Cell+365" doesn't work for either of my requirements.

In my research I found this formula: =DATE(YEAR(B7)-1,MONTH(B7),DAY(B7))+WEEKDAY(B7)-WEEKDAY(DATE(YEAR(B7)-1,MONTH(B7),DAY(B7))) it figures the previous year and rearranging the formula it is so close but it screws up the leap year as you can see in my example.

Any advise from the excel wizards?

Thanks in advance.
 

Attachments

  • excel help.png
    excel help.png
    33.1 KB · Views: 21

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
With a date in B7..
If you have a version of Excel with the WORKDAY.INTL function....try this regular formula:
Code:
=WORKDAY.INTL(B7,52,RIGHT(11111111-10^(8-WEEKDAY(B7,2)-1),7))
(The 3rd argument would typically be a 7-character text string containing some combination of 1's and 0's
where 1's represent non-workdays and 0's represent workdays...Starting with Mondays. So 1101111 would only count Wednesdays as workdays.
That formula builds the text string based on the weekday of the referenced cell.)

Is that something you can work with?
 
Upvote 0
Another way with date in B7
Code:
=WEEKDAY(DATE(YEAR(B7) +1,MONTH(B7), DAY(B7)))
 
Upvote 0
Ron: I don't think I have a version that can use this file. I am on old version of excel.

JLG: When I tried your formula I get a single number as apposed to a date When I convert to a date format I am getting the year 1900.
 
Upvote 0
The single number should be the day of the week with 1 being Sunday and 7 being Saturday. Did you want the day Spelled out?
VBA Code:
=TEXT(WEEKDAY(DATE(YEAR(B7) +1,MONTH(B7), DAY(B7))), "dddd")
 
Upvote 0
(edited to streamline the formula a bit)
I just checked my formula stash and re-discovered this little gem.
Code:
=B7+365-WEEKDAY(B7-WEEKDAY(B7,2))


Is that something you can use?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,269
Members
449,219
Latest member
daynle

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