Jan 02, 2025 02:44 AM
Hi,
I want to create a formula to create a name for a field that consists of "FIELDA" or "FIELDB"
If "FIELDA" has no value i would like to show "FIELDB" in the name instead. If "FIELDA" and "FIELDB" both have a value, I would only like to have "FIELDA" filled in the name of that field. If both have no value, no value should be shown.
Thanks for helping out!
Mark
Jan 02, 2025 02:52 AM
Hey @Marksteady!
Please use the following formula!
IF(FIELDA,
FIELDA,
IF(FIELDB,
FIELDB,
BLANK()
)
)
Let me know if this solves your issue.
Jan 02, 2025 03:58 AM
Hi Mike,
That doesn't seem to work?
Jan 02, 2025 04:01 AM
You missed second closing bracket. But in general, I wouldn't recommend to use BLANK() in Airtable, it just raise the level of chaos in formula and probability to make mistake.
Simple
IF(FIELDA,FIELDA,FIELDB)
does the job.
Jan 02, 2025 04:28 AM
Hi @Alexey_Gusev that seems to work better! The only thing is that I need the field to be blank when there FIELDB is empty.
Jan 02, 2025 04:29 AM
screenshot to clarify: I'd like it to not say "OPP" if there is no "Opportunity ID" is provided
Jan 02, 2025 05:28 AM
"I need the field to be blank when there FIELDB is empty. " - my logic was "It displays FIELDB so when it is empty, it displays nothing".
In you clarified example, use @Mike_AutomaticN solution. Just pay attention that when your cursor is on closed bracket the formula editor shows you that it 'belongs' to the second IF.
While first IF bracket remains unclosed and formula editor marks it by red. So you need to add another closing bracket in the end.
You can leave BLANK() as is or just remove it. Airtable formulas are flexible and allow condition like
IF(Field, Field) without third parameter