Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 09, 2019 02:38 PM
I have four name fields that I wish to concatenate.
First Name-1, First Name-2, Last Name-1 and Last Name-2.
Objective:
If First Name-2 and Last Name-2 two are both black, return First Name-1 Last Name-1
If First Name-2 is not blank and Last Name-2 is blank, return First Name-1 & First Name-2 Last Name-1
If both First Name-2 and Last Name-2 are not blank, return First Name-1 Last Name-1 & First Name-2 Last Name-2
I am new to Airtable.
Thanks
Aug 09, 2019 04:40 PM
Hi Gary,
Sounds like you’re creating a wedding mailing list or similar. I would use nested IF logic: https://support.airtable.com/hc/en-us/articles/221564887-Nested-IF-formulas
Change the field where you want the concatenated result to a formula and try this one:
IF({Last Name 2} = BLANK(), {First Name 1} & " " & {Last Name 1}, IF({Last Name 1}={Last Name 2}, {First Name 1} & " & " &{First Name 2}& " " & {Last Name 1}, {First Name 1} & " " &{Last Name 1} & " & " &{First Name 2} & " " &{Last Name 2}))
Aug 09, 2019 06:09 PM
Looking at your criteria, I see some interesting patterns that can be used to simplify the formula a bit.
With those in mind, here’s an alternative formula:
{First Name-1} &
IF(
AND({First Name-2}, NOT({Last Name-2})),
" & " & {First Name-2}
) &
" " & {Last Name-1} &
IF(
AND({First Name-2}, {Last Name-2}),
" & " & {First Name-2} & " " & {Last Name-2}
)
Aug 11, 2019 09:16 AM
Thank you VERY much.
Gary Nelson