×
英语
很抱歉。本文没有你的语言版本。

Check if a cell contains text (case-sensitive)

Let's say you want to find text that begins with a standard company prefix, such as ID_ or EMP-, and this text must be in uppercase letters. There are several ways to check if a cell contains text and the case of the text matters to you.

Compare one cell to another cell

To do this task, use the EXACT function.

Note: EXACT is case-sensitive but ignores formatting differences.

An example using the EXACT function to compare one cell to another

Compare one value to a list of values

To do this task, use the EXACT and OR functions.

An example using OR and EXACT functions to compare one value to a list of values

Note: The formula in the example must be entered as an array formula. After you enter the formula. press F2, and then press CTRL+SHIFT+ENTER. Excel inserts curly brackets at the beginning and end of the formula. If the formula is not entered as an array formula, the error #VALUE! is returned. For more information on array formulas, see Guidelines and examples of array formulas.

Check if part of a cell matches specific text

To do this task, use the IF, FIND, and ISNUMBER functions.

Note: The FIND function is case-sensitive.

An example using IF, ISNUMBER, and FIND functions to check if a part of a cell matches specific text

The formula in the above screenshot uses the following arguments.

Formula to check for text

Formula to check for text

  1. search_for: What you want to check for.

  2. to_search: The cell that contains the text that you want to check.

扩展你的 Office 技能
了解培训
抢先获得新功能
加入 Office 预览体验计划

此信息是否有帮助?

谢谢您的反馈!

谢谢你的反馈! 可能需要转接到 Office 支持专员。

×