Forum Discussion

GlynWilliams's avatar
GlynWilliams
Copper Contributor
Jan 30, 2021
Solved

If statements with multiple conditions

Hello!  I'd like to manage an If formula to allow multiple text indicators.  I have a list of cities in on column -- LA, SF, NY, Chicago, etc. I then want to create columns for each city to the rig...
  • mathetes's avatar
    Jan 30, 2021

    GlynWilliams 

     

    If you have the flexibility to name cities with the same abbreviation that is in your header, then it's a fairly simple formula: =IFERROR(IF(FIND(G$2,$F3)>0,"X"),"")

    That formula can be copied to every cell in that table and work. But it works when the values in the cell in column F look like this, not when you have the abbreviation in the heading (BOS) but the full name spelled out ("Boston") in the cell being evaluated.

    OR you could spell the name out fully in each case and that too would work. What you need is consistency.

     

    You and I with our more flexible brains are able to know DFW means Dallas/Fort Worth, and a formula could be written to let Excel recognize it as well, or perhaps a table created to for the formula to refer to.

    I guess the question to you is how super sophisticated (i.e., flexible) you want the solution to be.

Resources