只留下 Google 表格中的数字

Leaving behind just numbers in Google Sheets

我在 Google 表格中有一列有 phone 个数字,格式如下:

  1. (904) 123 4567
  2. +62 123 4567
  3. +12345678

如何创建另一个自动删除“+”、“(”、“)”和空格以生成 9041234567 的列?

谢谢

您可以用空替换所有非数字。

=ArrayFormula(regexreplace(A2:A4&"", "\D+",))

改变范围以适应and/or使用开放式范围

=ArrayFormula(if(len(A2:A), regexreplace(A2:A4&"", "\D+",),))

您可以只使用 REGEXREPLACE 删除不需要的字符:

=REGEXREPLACE(A1; "[ \(\)\+]"; "")

表达式使用[ \(\)\+],删除字符spaceright and left parenthesisplus sign。只需添加您要删除的所有其他字符。