Formula Help

Options

I am getting an incorrect argument error with the below formula.

I am trying to collect data from different sheets based on whether the cell value in the Airside / Landside column is Airside or Landside.

=IFERROR(IF([Airside / Landside]@row = "Airside", INDEX(COLLECT({EqNo}, {Employee ID}, [Employee #]@row), 1), IF([Airside / Landside]@row = "Landside", INDEX(COLLECT({LSEQNo}, {LS Employee Number}, [Employee #]@row), 1),"Employee Not Listed")

Thanks!

Best Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 07/25/22 Answer ✓
    Options

    Try inserting a second and third closing parenthesis after the final INDEX/COLLECT.


    [Employee #]@row), 1))),"Employee Not Listed")

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    edited 07/25/22 Answer ✓
    Options

    @Ronald Anderson

    The incorrect argument set error is being thrown because of syntax and a missing argument.

    Let's start with the nested IFs. You have two IF statements, so for sure at the end of your IFs you'll need two end parentheses, because you have to close out both IFs. So to start with, add a second end parentheses after "Employee Not Listed")

    Next, you have your IFERROR. The syntax for IFERROR is =IFERROR(value/formula, value if there's an error). Right now you just just have the =IFERROR(value/formula) part, so you're missing the value if there's an error. If you want "Employee Not Listed" to be the value if error, try closing off your two IFs before that value (see bold end parentheses):

    =IFERROR(IF([Airside / Landside]@row = "Airside", INDEX(COLLECT({EqNo}, {Employee ID}, [Employee #]@row), 1), IF([Airside / Landside]@row = "Landside", INDEX(COLLECT({LSEQNo}, {LS Employee Number}, [Employee #]@row), 1)),"Employee Not Listed")

    If you want some other value for the error condition, close the IFs after "Employee Not Listed" and specify that other value afterward:

    =IFERROR(IF([Airside / Landside]@row = "Airside", INDEX(COLLECT({EqNo}, {Employee ID}, [Employee #]@row), 1), IF([Airside / Landside]@row = "Landside", INDEX(COLLECT({LSEQNo}, {LS Employee Number}, [Employee #]@row), 1),"Employee Not Listed")), "Value if Error")

    Regards,

    Jeff Reisman

    Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages

    If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 07/25/22 Answer ✓
    Options

    Try inserting a second and third closing parenthesis after the final INDEX/COLLECT.


    [Employee #]@row), 1))),"Employee Not Listed")

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    edited 07/25/22 Answer ✓
    Options

    @Ronald Anderson

    The incorrect argument set error is being thrown because of syntax and a missing argument.

    Let's start with the nested IFs. You have two IF statements, so for sure at the end of your IFs you'll need two end parentheses, because you have to close out both IFs. So to start with, add a second end parentheses after "Employee Not Listed")

    Next, you have your IFERROR. The syntax for IFERROR is =IFERROR(value/formula, value if there's an error). Right now you just just have the =IFERROR(value/formula) part, so you're missing the value if there's an error. If you want "Employee Not Listed" to be the value if error, try closing off your two IFs before that value (see bold end parentheses):

    =IFERROR(IF([Airside / Landside]@row = "Airside", INDEX(COLLECT({EqNo}, {Employee ID}, [Employee #]@row), 1), IF([Airside / Landside]@row = "Landside", INDEX(COLLECT({LSEQNo}, {LS Employee Number}, [Employee #]@row), 1)),"Employee Not Listed")

    If you want some other value for the error condition, close the IFs after "Employee Not Listed" and specify that other value afterward:

    =IFERROR(IF([Airside / Landside]@row = "Airside", INDEX(COLLECT({EqNo}, {Employee ID}, [Employee #]@row), 1), IF([Airside / Landside]@row = "Landside", INDEX(COLLECT({LSEQNo}, {LS Employee Number}, [Employee #]@row), 1),"Employee Not Listed")), "Value if Error")

    Regards,

    Jeff Reisman

    Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages

    If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

  • Ronald Anderson
    Ronald Anderson ✭✭✭✭
    Options

    Thank you both for your helpful and quick response!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!