Help

Re: Nested IF for three options

2718 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Dgmknzgrl
6 - Interface Innovator
6 - Interface Innovator

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).
 
Name-Org.jpg
 
Thanks in advance!
11 Replies 11

Try this:

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

Resulting in this:
Screenshot 2023-07-28 at 12.23.37 PM.png

IF(Organization,
  IF({Full Name},
  {Full Name}&' ('&Organization&')',
  Organization),
{Full Name})
Dgmknzgrl
6 - Interface Innovator
6 - Interface Innovator

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...?

try no. 1.jpg

try no. 2.jpg

  

 

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})

 

 

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....

try no 3.jpg

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  😀

Alexey_Gusev_0-1690586697025.png

 

@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.   

Dgmknzgrl_2-1690813750317.png

 

 

 

Try this:

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

Still getting the same result for some reason. 

Dgmknzgrl_0-1690819350597.png