Calculating days in a month from a date
Justin Mauzy
✭✭✭✭✭
I need to calculate the days in a month from a date.
I have 2 columns:
- Check-In Date
- Check-Out Date
What I want to do is the following:
- Create 2 columns:
- Days in Current Month
- Days in Next Month
- On the 2nd entry, I want to count the days in July. So the returned value would be 1.
- Ignore the 3rd entry since all of the days fall in July.
- Then count the August day in the 4th entry for a value of 6.
Thanks in advance.
Best Answer
-
First month:
=(IFERROR(DATE(YEAR([Check-In Date]@row), MONTH([Check-In Date]@row) + 1, 1), DATE(YEAR([Check-In Date]@row) + 1, 1, 1)) - 1) - [Check-In Date]@row
Second Month:
=DAY([Check-Out Date]@row
Answers
-
First month:
=(IFERROR(DATE(YEAR([Check-In Date]@row), MONTH([Check-In Date]@row) + 1, 1), DATE(YEAR([Check-In Date]@row) + 1, 1, 1)) - 1) - [Check-In Date]@row
Second Month:
=DAY([Check-Out Date]@row
-
It works perfectly. Thank you for the help!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Want to practice working with formulas directly in Smartsheet?
Check out the Formula Handbook template!
Check out the Formula Handbook template!