Return Value from a state - city combo

Options
mahmadi
mahmadi ✭✭
edited 10/03/23 in Formulas and Functions

hello all,

I have a column that represnets inforation in three different format . For example, Austin, TX, Remote - Texas, or Austin, TX (1234). in all three scenarios I need to bring back the state name (Texas in this example). I have a state abbreviation reference sheet which has name of the states in the first column and the abbreviation in the 2nd column which i have usedin this formula. can someone help me with this and advise why it is not working and how can I make it work?

=IF(ISNUMBER(SEARCH("Remote -", [Current Staff Location]@row)), "Remote",

IF(ISNUMBER(SEARCH(",", [Current Staff Location]@row)), TRIM(MID([Current Staff Location]@row, FIND(",", [Current Staff Location]@row) + 1, LEN([Current Staff Location]@row))),

IF(ISNUMBER(SEARCH("(", [Current Staff Location]@row)),

MID([Current Staff Location]@row, SEARCH("(", [Current Staff Location]@row) + 1, SEARCH(")", [Current Staff Location]@row) - SEARCH("(", [Current Staff Location]@row) - 1),

VLOOKUP(TRIM([Current Staff Location]@row), {Abbrev}, 1, FALSE)))))

@Genevieve P. @Andrée Starå @Paul Newcome

Answers

  • mahmadi
    mahmadi ✭✭
    Options

    Have also tried this but says unparsable:


    =IF(ISNUMBER(SEARCH("Remote -", [Current Staff Location]@row)), TRIM(MID([Current Staff Location]@row, FIND(" - ", [Current Staff Location]@row) + 3, LEN([Current Staff Location]@row))),

    IF(ISNUMBER(SEARCH("(", [Current Staff Location]@row)), TRIM(MID([Current Staff Location]@row, 1, FIND(",", [Current Staff Location]@row) - 1)),

    VLOOKUP(TRIM(MID([Current Staff Location]@row, FIND(",", [Current Staff Location]@row) + 1, LEN([Current Staff Location]@row))), {Abbrev}, 1, FALSE))))

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    Options

    Hi @mahmadi

    I hope you're well and safe!

    Can you share some screenshots? (Delete/replace any confidential/sensitive information before sharing) That would make it easier to help.

    I hope that helps!

    Be safe, and have a fantastic week!

    Best,

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up, Awesome, or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!