• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Formula for 'Get next day of week'|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Formula for 'Get next day of week'|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Formula for 'Get next day of week'
sp_PrintTopic sp_TopicIcon
Formula for 'Get next day of week'
Avatar
Kevin Junk
Member
Members
Level 0
Forum Posts: 23
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
1
July 9, 2019 - 11:55 am
sp_Permalink sp_Print

This has me a bit baffled - there is a technique (a formula) for deriving the next day of the week following any other day of the week, eg. the next Friday following (the preceding) Wednesday. The formula is:

=A1+7 - WEEKDAY(A1+7 - 6), where A1 is the 'start date'.

The formula will generate the next following Friday (because the very last item in the formula before the closing bracket is the numeral 6 which represents, in Excel, Friday). So if I change that 6 to a 4 it will generate the next 'Wednesday'.

Within the WEEKDAY formula it advances the 'start date' by 7 days and then deducts Excel's 'day of the week' numeral, and then in turn evaluates that with Excel's 'day of the week' formula again - why does this work?

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 871
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
July 10, 2019 - 6:36 am
sp_Permalink sp_Print

Hello,

There is a good explanation here on how this formula works.

Avatar
Kevin Junk
Member
Members
Level 0
Forum Posts: 23
Member Since:
October 18, 2018
sp_UserOfflineSmall Offline
3
July 15, 2019 - 8:29 am
sp_Permalink sp_Print

Yeah I've seen that one and it doesn't really do it for me ... the throw away line '... by subtracting the result of a calculation that uses the WEEKDAY function.' doesn't really help.

Oh well, I'll just have to die not knowing, as they say.

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 871
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
4
July 18, 2019 - 8:04 am
sp_Permalink sp_Print

Hello Kevin,

The linked explanation is in my view clear enough, it is all about mathemathics.

As you want to know the next occurence of a certain weekday from a certain date you need to add 7, if you want to know the second next occurence you add 14 etc. So this explains why you add with +7 in the formula.

What the WEEKDAY function gives you is the number of the day in the week, by default starting with Sunday as first day in the week and thus Saturday as the last, which then gives us following list (as you already know, just listing this for other readers).

Sunday = 1
Monday = 2
Tuesday = 3
Wednesday = 4
Thursday = 5
Friday = 6
Saturday = 7

So, what is happening in the WEEKDAY part of the formula is following:
WEEKDAY('Start Date' + 7 - 6) where Start Date = 17/7/2019.

Adding the numbers we then have following:
WEEKDAY(43663 + 7 - 6)

Adding the number 7 now.
WEEKDAY(43670 - 6) where 43670 = 24/7/2019

As we want to know next occurence of Friday, we subtract with 6, which corresponds to Friday in Excel's list of weekdays.
WEEKDAY(43664) which as a date is = 18/7/2019, which is a Thursday. So the result we get from this is 5.

So if we use the complete formula we will get following result:
='Start Date' + 7 - WEEKDAY('Start Date' + 7 - 6)

Speeding up a bit:
=43670 - 5
=43665, which is 19/7/2019, which is Friday this week.

Not sure if I managed to make it more clear, but it is just a matter of drilling down to the numbers.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Jeanine Hagge
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27293

 

Member Stats:
Guest Posters: 49
Members: 31916
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.