IF formula for date and text in the same cell.
Hi,
I currently have this formula for a cell:
=IF(AND([Quote Validity]62 < TODAY(), ISDATE([Quote Validity]62)), "EXPIRED")
However, if I need to put anything other than a date for Quote Validity cell. It returns an "#INVALID OPERATION"
What needs to be added to that formula so when a text, besides a date is inputted, it doesn't input anything (cell is just blank).
Thanks.
Best Answer
-
I tested it a little further and if your "Quote Validity" column is a date column I think it works as expected. You can still enter text into that column as long as you leave the "Restrict to Dates" box unchecked.
- If the date is in the past, show EXPIRED
- If the date is in the future, show nothing
- If the date is text, show nothing.
Also, if I'm understanding this correctly, you don't actually need the ISDATE part of the formula. The below formula is doing the same thing.
=IFERROR(IF([Quote Validity]@row < TODAY(), "EXPIRED"), "")
I hope that helps.
Matt
Answers
-
You should add an IFERROR function to the formula. It would look something like below.
=IFERROR(IF(AND([Quote Validity]62 < TODAY(), ISDATE([Quote Validity]62)), "EXPIRED"),"")
I hope that helps.
Matt
-
If a date is in the past, it doesn't input "EXPIRIED" now.
-
I tested it a little further and if your "Quote Validity" column is a date column I think it works as expected. You can still enter text into that column as long as you leave the "Restrict to Dates" box unchecked.
- If the date is in the past, show EXPIRED
- If the date is in the future, show nothing
- If the date is text, show nothing.
Also, if I'm understanding this correctly, you don't actually need the ISDATE part of the formula. The below formula is doing the same thing.
=IFERROR(IF([Quote Validity]@row < TODAY(), "EXPIRED"), "")
I hope that helps.
Matt
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 444 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives