Sep 28, 2023 02:48 PM
I know using a formula like this-
IF(
{T-Shirt Size} = "extra small",
DATEADD({Expected Final Files}, -2, 'days'),
IF(
{T-Shirt Size} = "small",
DATEADD({Expected Final Files}, -6, 'days'),
IF(
{T-Shirt Size} = "medium",
DATEADD({Expected Final Files}, -13, 'days'),
IF(
{T-Shirt Size} = "large",
DATEADD({Expected Final Files}, -22, 'days'),
IF(
{T-Shirt Size} = "extra large",
DATEADD({Expected Final Files}, -30, 'days'),
""
)
)
)
)
)
And still get the same error message from Airtable. If anyone could please advise, I would truly appreciate it. Thanks!
Sep 28, 2023 03:25 PM - edited Sep 29, 2023 12:12 AM
You can't change the text formatting in a field unless it's a Long text field with rich formatting turned on, unfortunately. The formatting options in a formula field are the same as those in a date time field (or number/currency/percent field, depending on what your formula outputs).
That being said, if you'd like to know how to get rid of the error message you're seeing, for the first formula, just remove all the DATETIME_FORMAT functions. DATETIME_FORMAT outputs a string representation of a date, which Airtable then sees only as a text string and not a date; for the second formula, you'll need to delete the else portion of the innermost IF function (the ,"" for the extra large size), since it lets the formula output a string (in every other outcome of the formula, you'd get a date object).
Side note: you can change the nested IF functions into a single SWITCH function, which can help with legibility and maintenance. For example, the first formula would look like:
IF( {T-Shirt Size},
DATETIME_FORMAT(
WORKDAY( {Expected Final Files},
SWITCH( {T-Shirt Size},
"extra small", -2,
"small", -6,
"medium", -13,
"large", -22,
"extra large", -30
)
),
'MM/DD/YYYY')
)
(The IF function is to catch cases where {T-Shirt Size} is empty. You can also add an extra argument to the SWITCH function to catch cases where {T-Shirt Size} isn't one of the listed options.)
As an alternative to bold text, if you want to call attention to the field, you can use colours if your plan allows for it, or maybe emoji. There is also the highly janky, early 2000s method of replacing the numbers with those from the bold math section of Unicode, using SUBSTITUTE for each individual digit (there's no heavy slash in Unicode that I'm aware of); you can quickly preview such digits using a site like https://yaytext.com/bold-italic/ . Note that I haven't tried to nest that many SUBSTITUTE functions, but it should work in theory. Note also that the resulting numbers may not display properly nor will they be automatically converted to regular numbers when copied and pasted.