IF function with many conditions

I have an internal client who wants to parse a list of 100 different zip codes, and depending on the zip, assign another text field into a different field.

In other words, IF zip code = 11733 OR 11725 OR 11890 (and so on) THEN assign to New York.

Maybe there is a way other than using IF?

Thanks for any help you can provide,

Grace Barry

Comments

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    There is a MUCH easier route than trying to use a bunch of IF's. Build a table as below (column names in bold):

     

    StateT               ZipT

    NY                     ####1

    NY                     ####2

    WV                    ####3

    MD                    ####4

    NY                     ####5

     

    You can then use 

     

    =INDEX(StateT:StateT, MATCH([Zipcode Column Name]@row, ZipT:ZipT, 0))

     

    This will look down your list of zipcodes in your table and pull the state from the same row. The table can be sorted, added to, rows deleted, rows changed, and will still work. This can also be used with cross sheet references if you wanted to keep your table separate from the main sheet.

  • Paul, thank you for the prompt reply. I am excited to try this. I'll let you know my results.

     

    Grace

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    I would suggest starting off small scale. Just a few zips and states to make sure it works and is actually what you need. No sense building a huge setup only to find it isn't quite the solution you needed.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!