![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
What can I change so that the date in this formula is always a day of the week
=now()+30 if it equals saturday or sunday I want it to round the date up or down to the nearest weekday Any Ideas |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: May 2002
Posts: 13,278
|
You could try using the weekday function to determine whether now()+30 returns a 1 (sunday) or a 7 (saturday) & change accordingly.
This should work, =IF(WEEKDAY(NOW()+30)=1,NOW()+31,IF(WEEKDAY(NOW()+30)=7,NOW()+29,NOW()+30)) Paddy |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Thanks Paddy just what I needed
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
=WEEKDAY(NOW(),30) or =WEEKDAY(TODAY(),30) will suffice. You can even exclude the holidays. See the Help file how that's done. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|