Help

Issue with DATETIME_DIFF - Getting NaN error when there's no Data Available

Topic Labels: Formulas
796 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Leo_Mystic_Magi
4 - Data Explorer
4 - Data Explorer

Hello, I’m having an issue with comparing two different dates to figure out how many days elapsed from the date listed to the date sold. Here’s my formula below that I’m currently using. How can I alter the formula so that if there are no dates entered into those fields it will just show up blank? Thanks for any help you can provide!

DATETIME_DIFF({Sold On},{Listed},‘days’) & ’ Days’

Screen Shot 2020-09-04 at 11.15.49 AM

1 Reply 1
Kris
6 - Interface Innovator
6 - Interface Innovator

Hi Leo,

You can use an IF statement to check if the fields are filled, and then only show the days if they are.

Something like this:

IF(AND({Listed}, {Sold On}),DATETIME_DIFF({Sold On},{Listed},'days')&" Days")

Or if you wanted to show something instead of blank, you can do this:

IF(AND({Listed}, {Sold On}),DATETIME_DIFF({Sold On},{Listed},'days')&" Days", "DATES NOT SET")

Cheers :slightly_smiling_face: