Dec 02, 2023 03:55 PM - edited Dec 02, 2023 03:56 PM
Trying to get 'Full Name', 'Organization' in my primary field. My problem is that sometimes both 'Full Name' and 'Organization' are filled in, and sometimes it's only one or the other. I tried using the following formula, and it worked when one or the other is filled in, but when both are filled in, it doesn't add the comma and space. I'll attach an image so it's clear what I mean.
IF({Full Name}, {Full Name} &
IF({Organization}, {Organization} &
IF(({Full Name}+{Organization}),({Full Name} & ", " & {Organization}))))
Solved! Go to Solution.
Dec 04, 2023 06:17 AM
I guess your {Full Name} formula is something like {First Name} & " " & {Last Name}, so it is never empty.
You can wrap it all into TRIM( ) and that will solve the problem.
Or you can trim it in the Customer formula,
I think, that should work OK:
{Full Name} & IF( AND(TRIM({Full Name}),{Organization}), ", ") & {Organization}
Dec 02, 2023 05:59 PM
In Airtable, for example, the formula would look like this
IF(
OR({Full Name}, {Organization}),
IF(
{Full Name},
{Full Name} &
IF(
{Organization},
", " & {Organization}
),
{Organization}
)
)
Dec 02, 2023 08:44 PM
Hi,
IF(Field1 + Field2, .... - doesn't work
there are two ways to check,
IF(AND(Field1,Field2), 'both not empty') or
IF(Field1, IF(Field2,'both not empty'))
Regarding your formula, part of it is redundant.
Your desired result is
{Full Name} & ", " & {Organization}
when a field (any or both) is empty, nothing changes for side parts. But delimiter needs only for 2 values, so
{Full Name} & IF({Full Name},IF({Organization},", ")) & {Organization}
Dec 03, 2023 08:47 AM
Tried this and while it inserted the comma when both 'Full Name' and 'Organization' were found, it also inserted the comma and a space before the organization when only the 'Organization' was found.
Dec 03, 2023 08:48 AM
This, too, like the previous suggestion, inserted the comma when both 'Full Name' and 'Organization' were found—but also inserted the comma and a space before the organization when only the 'Organization' was found.
Dec 03, 2023 03:18 PM
If so, the Full Name may contain spaces.
Please check the formula.
Dec 04, 2023 06:17 AM
I guess your {Full Name} formula is something like {First Name} & " " & {Last Name}, so it is never empty.
You can wrap it all into TRIM( ) and that will solve the problem.
Or you can trim it in the Customer formula,
I think, that should work OK:
{Full Name} & IF( AND(TRIM({Full Name}),{Organization}), ", ") & {Organization}
Dec 04, 2023 03:41 PM
Hey, thanks! That did the trick!