Need a bit of help calculating a difference between two dates Using an IF statement to choose closing date

Hi folks... I'm a new adopter of SmartSuite and I've hit a bit of a snag. I had a formula in JS in AIRTABLE where I calculated the number of days between two points.
The Date Sent and the Reply Date -- if a reply had been received.
If no reply had been received then it calculated the number of days between Date Sent and Now.

Easy enough.

There are of course differences between the AIRTABLE and SMARTSUITE versions...
For example -- DATETIME_DIFF() needs to become DATEDIFF()
And BLANK() does not exist.
So - I'm using IFNONE to identify when the Reply Date is empty.

And I'm getting nowhere. Between Invalid Syntax errors and a refusal of the IF statements to work with number related functions - I'm at a loss. Add to that - my JavaScript abilities resemble me playing darts while wearing a blindfold. (I'll admit, I'm not good at it. There is a lot of 'experimentation' and swearing on my part. )
Any help would be greatly appreciated.
Many thanks.

(I have found the article on IF statements only returning the same type of value, but I'm trying to return a number of 'days' in both case? )

Here is what I have working in AIRTABLE:


IF([Date Sent],
IF([Reply Date],
ABS(
DATETIME_DIFF(
[Date Sent],
[Reply Date],
'days' )
) & " days",
IF([Reply Date]=BLANK(),
ABS(
DATETIME_DIFF(
NOW(),
[Date Sent], 'days' )
) & " days"
)))

2 replies