簡體   English   中英

Excel公式從字符串中提取數字

[英]Excel formula to extract numbers from string

我在excel中有一列,它包含兩種類型的字符串

  1. (423)242-0045 begin_of_the_skype_highlighting(423)242-0045 FREE end_of_the_skype_highlighting

  2. (630)472-1900 begin_of_the_skype_highlighting(630)472-1900 FREE end_of_the_skype_highlighting,(773)878-7340 begin_of_the_skype_highlighting(773)878-7340 FREE end_of_the_skype_highlighting

=IF(FIND(",",C2),LEFT(C2,FIND("begin",C2)-2)&","&MID(C2,FIND(",",C2)+2,14),MID(C2,FIND("begin",C2)+2,14))

我在上面的公式中提取了電話號碼。 喜歡:

  1. (423)242-0045
  2. (630)472-1900,(773)878-7340

但它適用於2.類型的字符串,但不適用於第一個字符串。

任何幫助將不勝感激

嘗試使用以下公式(假設輸入格式適合示例):

=TRIM(LEFT(A1,14)&IFERROR(", "&MID(A1,FIND(",",A1)+2,14),""))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM