Nesting IF statements that use the FIND function

Options

Hello all!

To preface, i've searched into nesting IF statements on the community and I believe i'm following the correct rules, but my result is #incorrect argument every time.

I made this function:

=IF(find("This Long Name",[Full Name]@row)=1, "TLN"+MID([Full Name]@row, 17,20), [Course Short Name]@row)

The column Full Name might have something like "This Long Name - Original Name Here"

So essentially: IF "This Long Name" is found in Full Name, Change it to "TLN", plus, add the rest of the Full Name after the first 17 characters; resulting "TLN Original Name Here"

If I attempt to nest this function, it always results in #incorrect argument

=IF(find("This Long Name",[Full Name]@row)=1, "TLN"+MID([Full Name]@row, 17,20), [Course Short Name]@row, =IF(find("This Other Name",[Full Name]@row)=1, "TON"+MID([Full Name]@row, 17,20), [Course Short Name]@row))

Since there doesn't appear to be a way to debug which argument is invalid, I'm not sure what is wrong here.

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    edited 01/28/21
    Options

    Try:

    =IF(LEFT([Full name]@row, 14) ="This Long Name", "TLN"+MID([Full Name]@row, 16, LEN(Full name]@row)-16), IF(LEFT([Full name]@row,15) ="This Other Name", "TON"+MID([Full Name]@row, 17, LEN([full name]@row)-17), [Course Short Name]@row))

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!