Return next day based on current day
This tutorial shows how to return the next day based on the current day through the use of an Excel formula or VBA
Example: Return next day based on current day
This formula uses a combination of Excel TEXT and TODAY functions to calculate the next day based on the current day. The formula uses the TODAY function to return today's date and then adds one day. This will return tomorrows date, which in this case would be 27/01/2019. Then using the TEXT function with the "dddd" criteria the formula returns the day from the date, which in this example in Sunday. Please note if you want to return the day number you will need to replace the "dddd" criteria with "d", which in this example will return a number of 27.
|
Sub Next_Day_based_on_Current_Day()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'return the next day based on the current day
ws.Range("B5") = Format(DateAdd("d", 1, Date), "dddd")
ws.Range("B5") = Format(DateAdd("d", 1, Date), "dddd")
End Sub
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("B5") in the VBA code.
Worksheet Selection: Select the worksheet where you want to return the next day based on the current day by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.
Output Range: Select the output range by changing the cell reference ("B5") in the VBA code.
Worksheet Selection: Select the worksheet where you want to return the next day based on the current day by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.
EXPLANATION
This tutorial shows and explains how to calculate the next day based on the current day using an Excel formula or VBA.
This tutorial provides one Excel method that can be applied to return the next day based on the current day with the use of the TEXT and TODAY functions. The TODAY function is used to return today's date and then we add a single day to return tomorrows date. Then using the TEXT function with the "dddd" criteria the formula returns the day.
Please note if you want to return the day number you will need to replace the "dddd" criteria with "d".
This tutorial provides one VBA method that can be applied to return the next day based on the current day.
FORMULA
=TEXT(TODAY()+1),"dddd")
=TEXT(TODAY()+1),"dddd")
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Return previous day based on current day | How to return the previous day based on the current day using Excel and VBA methods | |
Return next month based on current month | How to return the next month based on the current month using Excel and VBA methods | |
Return previous month based on a date | How to return the previous month based on a specific date using Excel and VBA methods | |
Return previous month based on current month | How to return the previous month based on the current month using Excel and VBA methods | |
Return next month based on a date | How to return the next month based on a specific date using Excel and VBA methods |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
TEXT Function | The Excel TEXT function returns a numeric value as text, in a specified format | |
TODAY Function | The Excel TODAY function returns the current date |