Help Workday Calculcations

Hello,
I try to put a date in a column 5.5 months before the end of my contract.
With the DATE function, it gives an INVALID VAL code for some dates and if I try with the WORKDAY function, it gives an INCORRECT code.
=IFERROR(IF([Fin contrat]@row >= TODAY(); DATE(YEAR([Fin contrat]@row); MONTH([Fin contrat]@row) - 5; DAY([Fin contrat]@row) - 15)); DATE(YEAR([Fin contrat]@row) - 1; MONTH([Fin contrat]@row) + 8; DAY([Fin contrat]@row) - 15))
=IFERROR(IF([Fin contrat]@row >= TODAY(); WORKDAY([Fin contrat]@row; -120); ""))
Can you help me.
I apologise for the mistakes. I don't speak english well.
Thanks,
Sonia
Answers
-
Try,Β
=[Fin contrat]@row - 167)
Below is how I arrived at 167 days for 5.5 months.
- 365 days in 1 year.
- 12 months in 1 year.
- (365/12) * 5.5 = 167
As to why your formula is failing...
- The expression
MONTH([Fin contrat]@row) - 5
will return values <1 when the month is January - May. - The expression
MONTH([Fin contrat]@row) + 8
will return values >12 when the month is May - December. - The expression
DAY([Fin contrat]@row) - 15
will return values <0 when the day of the month is less than the 16th.
These will three will cause the function DATE() to fail. In addition, you are using incorrect syntax for the functions. You can find documentation on Smartsheet functions here, https://help.smartsheet.com/functions.
Good luck!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.9K Get Help
- 474 Global Discussions
- 208 Use Cases
- 517 Announcements
- 5.6K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 84 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!