How can I calculate days between dates if a field is blank? (Days open counter)
My column property set to "text/number". The formula I am trying to use: =IF([Completion Date]@row = " ", "Closed", TODAY() - [Creation Date]@row)
I have a column named "Creation Date", then I have a column named "Completion Date". When there is a date in the completion date column I want it to populate "Closed". When the field (Completion Date) is left blank, I want to calculate the number of days it has been open.
Answers
-
Hi Jason,
It looks like you just have your formula backwards! IF statements are structured like so:
=IF this is true, then return this, if it's false return this.
Right now you're saying that if the Completion Date is blank you want it to say "Closed". Swap around your last two elements and it should work just fine! Try:
=IF([Completion Date]@row = "", TODAY() - [Creation Date]@row, "Closed")
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
Whether there is a date in there or not it will only return "closed" now.
-
Try taking away the space between your "quotes". To indicate a blank cell you'll want to have two quotes close together, like so: ""
Let me know if that fixed it!
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
When I did that it tells me "#invalid operation"
-
That tells us we're on the right track. You're getting the error from this part of the formula:
TODAY() - [Creation Date]@row
How are you populating the Creation Date column? This will need to be a date-type of column in order to subtract it from Today.
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
I put a date in there and it reads closed now, but the calculation of today - date gives the #invalid operation. So looks like I solved half of it.
-
Yes, it will have to do with the [Creation Date]@row not being seen as a date, which is why you're getting an error.
How are you populating the Creation Date column?
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
The Creation Date column properties was set to date. However that column is formulated to pull the date only (removing the times stamp) from the original coulumn which is autopopulated.
I referenced the original Date column (which included the time stamp) and it worked correctly.
Now I just removed the creation date column as it will no longer be needed.
Thank you for all your help.
-
No problem at all! I'm glad you were able to get it working. 🙂
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.1K Get Help
- 449 Global Discussions
- 155 Industry Talk
- 505 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 514 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!