Thread: [Solved] Date Formula
View Single Post
 
Old 11-22-2024, 06:42 AM
Karen615 Karen615 is offline Windows 11 Office 2021
Competent Performer
 
Join Date: Jun 2011
Location: Chicago
Posts: 145
Karen615 is on a distinguished road
Default

Quote:
Originally Posted by ArviLaanemets View Post
Or in A3 use (assumed the worksheet is never used at weekends, and you have to cope with state holidays otherwise)
Code:
=TODAY() - IIF(WEEKDAY(TODAY(),2)=1,3,1)
In case you need to take holidays also into account, you need a hidden calendar table with state holidays marked, and with a calculated column which returns the number of days to previous workday in case of holiday or weekend (p.e. for my country, this may be up to 5 days if I remember correctly), and 0 in case of workday. The formula in A3 will calculate the previous workday based on this hidden table.
Thank you so much for your help. If you have a chance, would you please explain this formula in layman's terms?

Also, I do need to deal with holidays. I'm not sure how to set up that hidden calendar.

Your help is greatly appreciated.
Thank you,
Karen
Reply With Quote