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.

附註:  我們想要以您的語言,用最快的速度為您提供最新的說明內容。 本頁面是經由自動翻譯而成,因此文中可能有文法錯誤或不準確之處。讓這些內容對您有所幫助是我們的目的。希望您能在本頁底部告訴我們這項資訊是否有幫助。 此為 英文文章 出處,以供參考。

SEARCH 會傳回指定字元或文字字串首次出現的字元位數 (從 start_num 起始)。使用 SEARCH 來決定另一文字字串中之字元或文字字串的位置,以便使用 MID 或 REPLACE 函數變更該文字。

語法

搜尋find_textwithin_text,[start_num

Find_text   是您想要尋找的文字。您可以使用萬用字元,問號 (?) 和星號 (*) find_text 中的。問號比對任何單一字元;星號比對任何系列字元。如果您想要尋找實際的問號或星號,輸入波狀符號 (~) 之前的字元。

Within_text     是要在其中搜尋 find_text 的文字。

Start_num   是您要開始搜尋的 within_text 中的字元數。使用 start_num 略過指定的字元數。例如,假設您正在使用的文字字串 「 AYF0093。YoungMensApparel 」。若要尋找的第一個"Y"的文字字串的描述性的組件中,將 start_num 設定為 8,而不搜尋文字的序列值部分。搜尋字元 8 開始、 find_text 尋找下一個字元,並傳回的數字 9。搜尋一律會傳回 within_text,計算您略過如果 start_num 大於 1 字元開頭的字元數。

備註

  • SEARCH 在搜尋文字時,無大小寫字母之分。

  • SEARCH 與 FIND 類似,但 FIND 有大小寫之分。

  • 如果找不到 find_text,則會傳回錯誤值 #VALUE!。

  • 如果省略 start_num,則會假設其值為 1。

  • 如果 start_num 不大於 0 (零) 或大於 within_text 的長度,則會傳回錯誤值 #VALUE!。

範例

欄 1

欄2

欄3

公式

說明 (結果)

Statements

Profit Margin

margin

=SEARCH("e",[欄1],6)

從第六個位置開始搜尋,第一個 "e" 在字串的位置 (7)

Statements

Profit Margin

margin

=SEARCH([Col3],[Col2])

"margin" 在 "Profit Margin" 中的位置 (8)

Statements

Profit Margin

margin

=REPLACE([Col2],SEARCH([Col3],[Col2]),6,"Amount")

用 "Amount" 替換 "Margin" (Profit Amount)

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!

×