Nested IF for three options

Topic Labels: Formulas
1499 11
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

I've spent a fair bit of time looking and IF, AND, OR, SWITCH formulas but can't seem to figure this out for making three different options using two fields with the correct punctuation.

I have two fields, {Full Name} and {Organization}.

If there is just a name, I want 'Full Name'

If there is just an organization, I want 'Organization'

If there is both a name and organization, I want 'Full Name (Organization)'

This is the least complicated of all the attempts made which seems to work, but I can't figure out how to get the brackets to behave.
IF({Full Name}=TRUE(),{Full Name},(IF({Full Name}=FALSE(),{Organization Name},{Full Name}&" ("&{Organization Name})))&")"

And a screenshot of what it looks like. The only one that is correct it the Name (Organization).

11 Replies 11
18 - Pluto

Try this:

``````IF(
AND(
{Full Name},
Organization
),
{Full Name} & " (" & Organization & ")",
IF(
{Full Name},
{Full Name},
Organization
)
)``````

Resulting in this:

12 - Earth
``````IF(Organization,
IF({Full Name},
{Full Name}&' ('&Organization&')',
Organization),
{Full Name})``````
5 - Automation Enthusiast

Hi all, thanks for the help.

For both of those formulas, I'm getting brackets around both 'organization' and 'full name (organization', and an error that says missing opening parenthesis...?

12 - Earth

That's because your field name is {Organization Name}, not Organization. (if field name contains space, it must be in brackets). I suppose you put wrong name in description, but your formula contains correct name.

So,

``````IF({Organization Name},
IF({Full Name},
{Full Name}&' ('&{Organization Name}&')',
{Organization Name}),
{Full Name})``````

5 - Automation Enthusiast

Hmmm, I changed the fields to be Organization Name and Full Name to match your example and copy/pasted your formula but I'm getting the same errors for some reason....

12 - Earth

I have the same warnings, but when I press Save, it's ok, and it works good.
On different projects I'm using complex and composed formulas and ... in short, linter often lies 🙂
So I just ignore these warnings if formula works as expected. Did you try to just press Save? If something really wrong with syntax, it won't let you  😀

5 - Automation Enthusiast

@Alexey_Gusev it accepts the formula for sure. And the formula works for Name (Organization) and Full Name, but I'm still getting ( ) around my Organization when it is the only item.

10 - Mercury

Try this:

IF(AND({Full Name}, Organization), {Full Name}&" ("&Organization&")", {Full Name}&Organization)

5 - Automation Enthusiast

Still getting the same result for some reason.