How to Use Excel IF OR Formula to Match Text in Multiple Columns
Question details
The user needs a formula to evaluate multiple text conditions across different columns and return a custom value based on whether any of those conditions are met.

- Product
- Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Filtering, categorizing, or flagging data rows based on multiple text criteria in different columns.
- Observed behavior
- The goal is to return a specific word (e.g., 'Include') if any of the specified text conditions evaluate to TRUE, and another word (e.g., 'Exclude') if none are met.
Ensure your dataset is organized into clear columns and identify the exact text strings or partial strings you want to match before applying the logical formulas.
Use the IF and OR Functions for Exact Text Matches
Combine the IF and OR functions to check if a cell exactly matches any of your specified text criteria across different columns.
The OR function evaluates multiple conditions and returns TRUE if at least one condition is met. Wrapping it in an IF function allows you to output custom text instead of just TRUE or FALSE.
Click the cell where you want the result (e.g., 'Include' or 'Exclude') to appear.
Type the OR function to establish your criteria. For example: =OR(A2="Fred1", A2="Fred2", B2="Blue", C2="Leave").
Combine it with the IF statement to return your custom text: =IF(OR(A2="Fred1", A2="Fred2", B2="Blue", C2="Leave"), "Include", "Exclude").
Press Enter to view the result, then drag the fill handle down to apply the formula to the rest of your data rows.

Use SEARCH and ISNUMBER for Partial Text Matches
Use this method if the target text is only a part of the cell's content (e.g., finding 'Fred1' within 'Fred1_Smith') rather than an exact match.
Master Logical Formulas Easily with WPS Spreadsheet
WPS Spreadsheet provides robust support for advanced logical functions like IF, OR, SEARCH, and ISNUMBER. It helps you efficiently analyze large datasets with intelligent formula suggestions and full compatibility with Microsoft Excel.
- 1. Open your dataset: Launch WPS Spreadsheet and open your target Excel workbook or CSV file.
- 2. Input the formula: Click on the result cell and begin typing =IF(OR(...)). Use the pop-up auto-complete suggestions to ensure perfect syntax.
- 3. Analyze the results: Press Enter, then double-click the bottom-right corner of the cell to instantly copy the formula down your entire data column.

Frequently Asked Questions
Can I use the AND function instead of OR in this formula?
You should only use the AND function if *all* conditions must be met simultaneously. Since your goal is to return 'Include' if *any* of the conditions are true, the OR function is the correct choice.
Why is my IF OR formula returning a #NAME? error?
This error typically occurs if you forget to put quotation marks around your text criteria (e.g., writing Blue instead of "Blue") or if a function name is misspelled. Double-check your formula syntax.
How many conditions can I include inside an OR function?
In both Excel and WPS Spreadsheet, you can include up to 255 conditions inside a single OR function, which is sufficient for highly complex data filtering tasks.




