Is There Anyway to Do the Equivalent to VLOOKUP in Excel?

I'm looking to do the equivalent of VLOOKUP in excel to convert state codes into state names within keyboard maestro.

NY -> New York
CA -> California
etc.

How would I do this?

Yep, this can be easily done using RegEx.
See this example which you should be able to adapt for your use case:

MACRO: Replace Text with Numbers (or, Lookup Data Using RegEx) [Example)]

Here's my industrial strength solution for states and their abbreviations. I use Associated Press state abbreviations as well as postal abbreviations so each state has two abbreviations in addition to its full name.

This macro substitutes the selection for any of the three. F2 substitutes the full name, Control-F2 substitutes the AP abbreviation and Option-F2 substitutes the two-character postal abbreviation.

States- Abbreviations.kmmacros (9.9 KB)

2 Likes

Just expanded on this solution with one that includes month names, abbreviations and numeric representations:

1 Like

Thanks to @ComplexPoint, this version corrects two issues with the list of abbreviations (a missing DC for District of Columbia and a space for a tab between Aug. and 08):

Abbreviations: States, Months Macro (v9.0.6)

Abbreviations- States- Months.kmmacros (10 KB)