Formula to calculate amount of days/weeks/months between two dates?
Answers
-
Will do, thank you!
-
@Jeff Reisman I came across this discussion when I was googling "how to count number of weeks between two dates". Your basic formula =WEEKNUMBER(EndDate@row) - WEEKNUMBER(StartDate@row) worked for me for the most part, but when the start date and end date are within different years, as in the first row in my snapshot below, the formula doesn't work. I believe that was touched on in this original discussion, but my eyes are bleeding trying to follow along and apply your solution to my specific issue. Are you able to help me out with a formula that works for me? Happy to provide further context if needed. Thank you!!!!
-
@Sandy Glassberg you'll want to add an IF statement to check for cases of the start date year being different than completed date year - and then provide a different calculation where that is true.
The logic is: if the start date year is less than completed date year, then count the weeks between 1/1/24 and the completed date, and add that to the number of weeks from start date to 12/31/24. Alternatively, you can just count number of days between completed and start dates and then divide by 7.) If both dates are in the same year, just calculate as normal.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Ah, that makes a lot of sense. Thank you for summarizing! The formula works!
-
formula for calculating number of months from start date or Date of joining which every is early till End date or Year end which every is early
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!