I am trying to make TAMPA, FL into Tampa, FL, but I don't know the correct formula to do this. Any ideas?
2 Answers
If you have Office 365, try:
=TEXTJOIN(",",TRUE,PROPER(TEXTBEFORE(A1,",")),UPPER(TEXTAFTER(A1,",")))
This is a bit long for a comment, though not an exact answer -- it would be if someone converted the VBA metacode as in this StackOverflow example to something useful:
- Use INSTR(RIGHT(line, 4), ", "), verify that the text in the line ends in comma + space + exactly two-character state (and province? territory?) postal abbreviation. (This presumes that two characters are always used, which is not true for Mexican states and other countries.) As part of verification, you might check that the two-character postal abbreviation is in a list.
- Split the cell with City, ST into two cells, possibly omitting the comma + space entirely (to be added back in later).
- Use PROPER() to fix City case (which will also correct multi-word cities, e.g., New York City.
- Use UPPER() to fix state abbreviations.
- This is a useful way to store the data, and may make postal code lookup[ easier.
PROPER()
I think you'll have to add a couple of other formulas to get exactly what you are looking for.