Help

Create a formula that prioritizes 1 field to fill in over another.

Topic Labels: Formulas
220 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Marksteady
5 - Automation Enthusiast
5 - Automation Enthusiast

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

 

6 Replies 6

Hey @Marksteady!

Please use the following formula!

IF(FIELDA,
FIELDA,
IF(FIELDB,
FIELDB,
BLANK()
)
)

Let me know if this solves your issue. 

Mike, Consultant @ Automatic Nation

Hi Mike,

That doesn't seem to work?

Marksteady_0-1735819073484.png

 

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.

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. 

screenshot to clarify: I'd like it to not say "OPP" if there is no "Opportunity ID" is provided 

Marksteady_0-1735820970431.png

 

"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

Alexey_Gusev_0-1735823030214.png