First Month's Date Range
Hello,
I'm looking to get a response like this: 07/01/23 - 07/31/23. I want to get the previous month's range based on the values in the column (The previous month could potentially have entries dating 9/1/23-9/25/23, for example).
I am referencing another sheet's column {REF DATE}. Dates range from 7/1/23 to 8/2/23 at this time.
My formula looks like: =MIN({REF DATE}) + " - " + MAX(COLLECT({REF DATE}, {REF DATE}, MONTH(@cell) = MONTH(MIN({REF DATE}))))
I get this error:#INVALID DATA TYPE
The issue is in MONTH(@cell) = MONTH(MIN({REF DATE})). I have this formula in a text column do to the concatenation. I tried ...COLLECT({REF DATE}, {REF DATE2},... with no luck.
What am I doing wrong? What can I do different?
Thank you for your time and consideration, Jason
Answers
-
Most likely there are either blank cells in the offending row, or maybe a blank row at the bottom of your sheet. MONTH() doesn't react well to blank rows. Putting an IFERROR() around each of those statements made this work for me in a test sheet.
=MIN({REF DATE}) + " - " + MAX(COLLECT({REF DATE}, {REF DATE}, IFERROR(MONTH(@cell), 0) = IFERROR(MONTH(MIN({REF DATE})), 0)))
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!