**請問表格中有以下數值
AAAAAA,2,2BBB,2,aaaa,2
CCCCC,222222
DDD,2,2222,EEE
..............................
.............................
........................
要將,2, 取代成 2,
以及尾數的,2也取代成2
希望的取代結果
AAAAAA2,2BBB2,aaaa2
CCCCC,222222
DDD2,2222,EEE
..............................
.............................
........................
試過幾種方法都因為組合的關係會取代錯誤,請問各位大神,有什麼方法可以取代嗎?**
笨做法
A1=AAAAAA,2,2BBB,2,aaaa,2
A2=CCCCC,222222
A3=DDD,2,2222,EEE
B1=SUBSTITUTE(A1,",2,","2,")
B2=SUBSTITUTE(A2,",2,","2,")
B3=SUBSTITUTE(A3,",2,","2,")
C1=IF(RIGHT(B1,2)=",2",LEFT(B1,LEN(B1)-2)&"2",B1)
C2=IF(RIGHT(B2,2)=",2",LEFT(B2,LEN(B2)-2)&"2",B2)
C3=IF(RIGHT(B3,2)=",2",LEFT(B3,LEN(B3)-2)&"2",B3)