Using IF, INDEX, MATCH

=IF(ISBLANK([Supervisor]@row), INDEX({Staff Database Primary Supervisor}, MATCH([Staff]@row, {_Staff Database Range 2}), 0), INDEX({Staff Database Email}, MATCH([Supervisor]@row, {_Staff Database Range 2}), 0)

I am trying to index a Supervisor email from one sheet to another by matching the Staff name, however if no staff matches I want to index the staff email by matching a submitted name to the staff name. I keep getting an #INCORRECT ARGUMENT SET

I need this to run when the supervisor is blank, but if the email is not found due to no Staff names matching, then I need it to run based on an inputed name and bring an email to match the inputed(supervisor) name.

Answers

  • Devin Lee
    Devin Lee ✭✭✭✭✭
    edited 06/04/24

    I made it one sheet and it seems to be working fine. Could it be you are just missing the ending parentheses?

    Your Code
    =IF(ISBLANK([Supervisor]@row), INDEX({Staff Database Primary Supervisor}, MATCH([Staff]@row, {_Staff Database Range 2}), 0), INDEX({Staff Database Email}, MATCH([Supervisor]@row, {_Staff Database Range 2}), 0)

    My Code
    =IF(ISBLANK(Supervisor@row), INDEX([Staff Database Primary Supervisor]:[Staff Database Primary Supervisor], MATCH(Staff@row, [Staff Database Range 2]:[Staff Database Range 2]), 0), INDEX([Staff Database Email]:[Staff Database Email], MATCH(Supervisor@row, [_Staff Database Range 2]:[_Staff Database Range 2]), 0))

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!