Formula Help
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
-
Try inserting a second and third closing parenthesis after the final INDEX/COLLECT.
[Employee #]@row), 1))),"Employee Not Listed")
-
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
-
Try inserting a second and third closing parenthesis after the final INDEX/COLLECT.
[Employee #]@row), 1))),"Employee Not Listed")
-
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!
-
Thank you both for your helpful and quick response!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!