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.

MID 會自文字字串中您所指定的位置開始,傳回特定數目的字元 (依據您指定的字元數目)。

語法

MID(text,start_num,num_chars)

文字     是含有您想選錄的部分字元之文字字串。

Start_num     為用以指定您要由 text 的第若干個位元組開始抽選。text 中的第一個字元為 start_num 1,依此類推。

Num_chars     定您要 MID 從字串傳回的字元組。

註解

  • 如果 start_num 大於文字的長度,MID 將傳回 " " (空字串)。

  • 如果 start_num 小於 text 的長度,但 start_num 加上 num_chars 的長度超過了 text 的長度,則 MID 會傳回到 text 結尾的所有字元。

  • 如果 start_num 小於 1,則 MID 會傳回錯誤值 #VALUE !。

  • 如果 num_chars 為負數,則 MID 會傳回錯誤值 #VALUE !。

範例

公式

說明 (結果)

=MID("Fluid Flow",1,5)

字串中從第 1 個字元起始的 5 個字元 (Fluid)

=MID("Fluid Flow",7,20)

字串中從第 7 個字元起始的 20 個字元 (Flow)

=MID("Fluid Flow",20,5)

因為起始位置大於字串的長度,所以傳回空文字 ()

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!

×