0

关于如何在 Excel 中分隔地址的任何想法。目前我有大约 300 个流动格式的地址:

1234 地址城市,AL 55555

我在网上查了一下,我发现了如何区分城市和邮政编码。现在我在单独的单元格中获取城市和地址时遇到问题。关于我如何做到这一点的任何想法?

4

1 回答 1

2

如果它总是采用这种精确的格式,那么如果这个城市只有一个单词(地址中的空格没有限制):

Addr:  =LEFT(A5,
        FIND("~",SUBSTITUTE(A5," ","~",FIND(",",A5)-1-LEN(SUBSTITUTE(LEFT(A5,FIND(",",A5)-1)," ","")))))
City:  =MID(A5,
        FIND("~",SUBSTITUTE(A5," ","~",FIND(",",A5)-1-LEN(SUBSTITUTE(LEFT(A5, FIND(",",A5)-1)," ",""))))+1,
        FIND(",",A5) - 1 - FIND("~",SUBSTITUTE(A5," ","~",FIND(",",A5)-1-LEN(SUBSTITUTE(LEFT(A5, FIND(",",A5)-1)," ","")))))
State: =MID(A1,FIND(",",A1)+2,2)
Zip:   =RIGHT(A1,5)
于 2013-01-03T00:12:00.047 回答