Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

IF and Combine or CONCATENATE Help

Topic Labels: Formulas
813 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I need help with a formula. I’m trying to combine some address fields to create a full address but it adds an extra space when an Address doesn’t have a {Address 2} such as apartment number. So i wanted to create an IF statement to check to see if that field is blank. Here is what I have and it not working it add all the address components together expect of the {Address 2}. Any suggestions would really help

`IF({Address 2} = BLANK(), {Address 1} & " " & {Address 2} &" " & {City} & " " & {State} & " " & {Zipcode}, {Address 1} & " " & {City} & " " & {State} & " " & {Zipcode})`
1 Reply 1

Welcome to the community, @Bushard_s_Delivery! :grinning_face_with_big_eyes: This should work:

{Address 1} & " " & IF({Address 2}, {Address 2} & " ") & City & " " & State & " " & Zipcode

Because only {Address 2} is optional, the IF() function only needs to wrap around that part. Also notice the shortcut syntax I used. By only including the field name, Airtable will evaluate the presence of any data that field as “true,” which will add that data and a separating space. If nothing is in {Address 2}, nothing will be added. Finally, note that curly braces aren’t required around field names containing only a single word and no special characters. I’ll often include them in commentary here for clarity, so you know when I mention {City} that it’s a field, but in the formula the braces can be omitted.