Thread: [Solved] Date Formula
View Single Post
 
Old 11-22-2024, 02:24 AM
ArviLaanemets ArviLaanemets is offline Windows 8 Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

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.
Reply With Quote