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
- 64.4K Get Help
- 424 Global Discussions
- 221 Industry Talk
- 464 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 61 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 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!