Using INDEX but returning blank if match found

sminagil
sminagil
edited 07/19/23 in Formulas and Functions

Hello,

I am using the following formula to reference another sheet:

=INDEX({DISASTER CLOSINGS Range 1}, MATCH([Store Id]@row, {DISASTER CLOSINGS Range 1}, 0))

This returns #NO MATCH for cells that, well frankly do not have a match, and the corresponding number if it does have a match. That works as intended.

But... I want the opposite. If the number exists on the "DISASTER CLOSINGS" sheet, I want it to return blank, and if the number does NOT exist on the "DISASTER CLOSINGS" sheet, I want it to return the value in the "Store Id" column.


Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Try this:

    =IF(INDEX({DISASTER CLOSINGS Range 1}, MATCH([Store Id]@row, {DISASTER CLOSINGS Range 1}, 0)) <> "", "", [Store ID]@row)

  • I am getting a "NO MATCH".


    I have changed my column names since I first posted trying to do a workaround.


    I am currently using:

    =IFERROR(INDEX({DISASTER CLOSINGS Range 1}, MATCH([All Stores]@row, {DISASTER CLOSINGS Range 1}, 0), 0), "")

    in the Store ID - Disasters column

    and:

    =IF(ISBLANK([Store ID - Disasters]@row), [All Stores]@row, "")

    in the Store ID column.

    It's a clunky workaround.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Does this work?

    =IF(IFERROR(INDEX({DISASTER CLOSINGS Range 1}, MATCH([Store Id]@row, {DISASTER CLOSINGS Range 1}, 0)), [Store ID]@row) <> [Store ID]@row, [Store ID]@row)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!