Invalid Data Type when Date column empty
Hi all,
I'm using the formula below to calculate the NETWORKDAYS
between the date an invoice was submitted until it is paid, if it has not been paid it calculates the NETWORKDAYS with TODAY. The formula is working, however, I'm getting an error on every row that does not have a date sent for payment yet. Is there a way to add IFERROR to this?
=IF(ISBLANK([Invoice Paid]@row), NETWORKDAYS([Date Sent for Payment]@row, TODAY()), NETWORKDAYS([Date Sent for Payment]@row, [Invoice Paid]@row))
Answers
-
The error comes from trying to run a calculation against a blank field. It's like trying to divide by zero 😁
You can avoid this in two different ways:
Method 1 - Limiting the formula to only run if there's a date value in the field,
Method 2 - suppressing the error message.
Method 1: Embed your IF inside an IF that checks for a date in the field
=IF(ISDATE([Date Sent for Payment]@row), IF(ISBLANK([Invoice Paid]@row), NETWORKDAYS([Date Sent for Payment]@row, TODAY()), NETWORKDAYS([Date Sent for Payment]@row, [Invoice Paid]@row)), "")
Method 2: Use IFERROR to suppress the error message.
=IFERROR(IF(ISBLANK([Invoice Paid]@row), NETWORKDAYS([Date Sent for Payment]@row, TODAY()), NETWORKDAYS([Date Sent for Payment]@row, [Invoice Paid]@row)), "")
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
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
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!