如何使用Excel公式将点转换为逗号十进制表示法

时间:2019-06-17 07:10:10

标签: regex google-sheets excel-formula google-sheets-formula array-formulas

假设用户在任何一个excel单元格中一一输入1.234.567,891,234,567.891 234 567,89,在上述所有情况下,用户应在输出中获得1234567,89单元格。

2 个答案:

答案 0 :(得分:2)

Excel

尝试使用自定义格式的TEXT()

=TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,",",""),".","")," ",""),"[>=100]#\,#0;#")

enter image description here

Google电子表格

尝试使用REGEXREPLACE()

=TEXT(REGEXREPLACE(TEXT(A1,"@"),"[ ,.]",""),"[>=100]#\,#0;#")

enter image description here

答案 1 :(得分:0)

=ARRAYFORMULA(IF(LEN(A1:A), 
 IFERROR(REGEXREPLACE(A1:A, "\s|\.", ), 
 REGEXREPLACE(""&A1:A, "\s|\.", ",")), ))

0