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!
-
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
Want to practice working with formulas directly in Smartsheet?
Check out the Formula Handbook template!
Check out the Formula Handbook template!