Formula to return both a calculation and text?

317 4
cancel
Showing results for
Did you mean:
4 - Data Explorer

I'd like to build a field that returns the days until due if >0, or "Assign Due Date" if Nan, or "Passed Due" if <0.

I am struggling to combine the IF statement with the following formula:

DATETIME_DIFF(

TODAY(),

'days'

)
Any tips on how to accomplish this?

4 Replies 4
4 - Data Explorer

Solved! Took a lot of trial and error, but got there in the end.

IF(
"Passed Due",
"Assign Due Date"
)
)
12 - Earth

Hi,
Glad that you solved it, but maybe this wll help you in future how to 'check for non-emptiness'. When Deadline is empty, you want to display 'Assign Due Date', and if assigned, show the state (Number of days to do or message when it is no more days)
So, it should be done in a following way:

``IF({Deadline},  something if Deadline set , something if Deadline empty )``

``````IF(Deadline,
'Passed Due'),
'Assign Due Date')``````

18 - Pluto

Also keep in mind that even though the number of days looks like a number, from Airtable’s point of view, it is text. Airtable will not be able to directly perform math on those values. If you only want human eyes to see the values, and don’t need to perform additional calculations, that might be fine.

4 - Data Explorer

To build a field that returns the days until due if greater than 0, "Assign Due Date" if the date is not assigned, or "Passed Due" if less than 0, you can combine the IF statement with the DATETIME_DIFF formula in Airtable. Here’s how you can structure the formula:

```IF(
IF(