Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

REPLACE 會根據您指定的字元數,以不同的文字字串來取代文字字串的某一部分。

語法

REPLACE(old_text,start_num,num_chars,new_text)

Old_text     是要取代其中某些字元的文字。

Start_num     是 old_text 中要以 new_text 取代的字元位置。

Num_chars     是要用 REPLACE 將 old_text 取代成 new_text 的字元數。

New_text     是要取代 old_text 中字元的文字。

範例

公式

說明 (結果)

=REPLACE("abcdefghijk",6,5,"*")

從第 6 個字元開始取代 5 個字元 (abcde*k)

=REPLACE("2009",3,2,"10")

以 10 取代 2009 中的最後兩位數 (2010)

=REPLACE("123456",1,3,"@")

以 @ 取代前 3 個字元 (@456)

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×