Skip to main content

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

 

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


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?

 


Hi Mike,

That doesn't seem to work?

 


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.


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. 


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 

 


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

 


"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

 

 


Reply