Table of Contents
Conditional formatting (CF) is an exceptionally powerful feature within spreadsheet applications like Microsoft Excel, enabling users to dynamically change the appearance of cells based on defined criteria. This visual enhancement is critical for data analysis, allowing immediate identification of trends, outliers, or specific data points that meet certain thresholds or characteristics. While simple conditional formatting handles single criteria effortlessly (e.g., highlighting values greater than 100), dealing with multiple, non-contiguous text values requires a more sophisticated approach involving custom formulas.
The true flexibility of CF is unlocked when you need to highlight cells that match any value from a predefined list. For instance, you might need to highlight all transactions categorized as “Urgent,” “Pending Review,” or “Escalated.” Simply applying three separate standard rules can become inefficient and difficult to manage. Instead, expert users leverage array-like formulas utilizing functions like COUNTIF and SUM within the CF Rule Manager to create a single, robust rule that checks against all criteria simultaneously, ensuring cleaner management and superior performance.
This detailed guide will walk you through the precise steps required to implement conditional formatting based on multiple text values in Excel. We will focus on utilizing a formula-based rule, accessed via the New Rule option found under the Conditional Formatting dropdown menu, located prominently within the Home tab of the Excel ribbon. This technique is essential for users who frequently handle large datasets requiring complex, multi-criteria visual filtering.
Setting Up the Dataset for Multi-Criteria Formatting
To demonstrate this advanced technique, we will use a sample dataset representing basketball player statistics. This dataset includes player positions and their corresponding points scored. Our goal is to highlight specific player positions—such as starting roles or specialized positions—that match our predefined list of criteria. This setup is crucial for demonstrating how the formula interacts with cell ranges containing various text entries, necessitating a formula capable of performing an “OR” logic check across multiple text strings.
Consider the following hypothetical table structured in Excel. Column A contains the Position (e.g., ‘Starting Point Guard’, ‘Power Forward’), and Column B contains the Points Scored. We must first visualize this data structure to understand the scope of the conditional formatting application. Note that the positions are descriptive and contain multiple words, meaning we must search for partial text matches.

In this scenario, our primary focus is applying formatting rules specifically to the Position column (range A2:A11). We are tasked with identifying and highlighting all cells in this range that contain one of several distinct text fragments. This requirement necessitates a sophisticated comparison mechanism, which is precisely what the combined use of the COUNTIF and SUM functions provides within the conditional formatting framework. The use of partial matching, enabled by wildcards in the formula, allows us to catch ‘Starting Point Guard’ when searching only for ‘Starting’.
Defining the Specific Text Criteria
Before creating the conditional formatting rule, we must formally define the specific text values we wish to target. This is a critical preparatory step that enhances the maintainability and readability of our eventual formula. For our example, we aim to highlight any cell in the Position column that includes one of the following terms, regardless of other text present in the cell:
- Starting
- Forward
- Center
Instead of hardcoding these values directly into the conditional formatting formula—which makes updates difficult and cumbersome—best practice dictates placing these criteria into a separate, dedicated range within the spreadsheet. By placing these specific texts in a dedicated location (e.g., cells D2 through D4), we can easily modify our criteria list in the future without needing to edit the complex conditional formatting rule itself. This separation of criteria definition and rule application is fundamental to creating efficient and sustainable spreadsheet models.
By isolating the list of criteria, we ensure that the conditional formatting rule remains robust even if the business logic or requirements change frequently. This modular approach is a hallmark of professional spreadsheet development, saving significant time during maintenance cycles.
Creating a Named Range for Criteria Lookup
To further streamline the process and make the formula highly intuitive, we will utilize Excel’s Named Range feature. A Named Range acts as an alias for a cell range, allowing us to refer to D2:D4 simply as a descriptive name within our formula. This practice drastically improves formula legibility and reduces the risk of referencing errors, especially when dealing with complex rules or when the formula needs to be reviewed by other users.
To establish the named range, perform the following steps: first, highlight the cells containing your specific text criteria (in our example, the range D2:D4). Next, locate the Name Box, which is typically situated in the top-left corner of the Excel window, just above Column A. Click inside the Name Box and type a meaningful, single-word name, such as specific_text, and press Enter.

By assigning the name specific_text to the range D2:D4, our conditional formatting formula will now reference this list directly using this intuitive label. This method not only simplifies the final formula but also allows Excel to handle the array processing necessary for checking against multiple values efficiently. This is a powerful technique for creating dynamic and maintainable spreadsheet solutions.
Initiating the Conditional Formatting Rule Creation
With our criteria defined and the named range established, the next crucial step involves applying the rule to the data column. We must first select the range where the formatting should be applied. In our case, this is the Position column, specifically the data cells A2:A11. It is vital to select the entire target range before opening the Conditional Formatting dialogue, as the active cell (usually A2, the top-left cell of the selection) dictates how the formula is evaluated and applied relative to every other cell in the selection.
Once the range A2:A11 is highlighted, navigate to the Home tab on the Excel ribbon. Locate and click the Conditional Formatting dropdown menu. From the options presented, select New Rule…. This action opens the New Formatting Rule dialog box, which is the gateway to creating custom, formula-based rules capable of handling intricate logic.

In the ensuing dialog, you will be prompted to select a Rule Type. We must choose the last option: Use a formula to determine which cells to format. This selection tells Excel that the formatting decision will rely entirely on the result (either TRUE or FALSE) of a custom mathematical or logical expression that we are about to enter. This type of rule provides the maximum flexibility needed for complex multi-criteria highlighting.
Implementing the Advanced COUNTIF and SUM Formula
The core of this powerful conditional formatting solution lies in combining the capabilities of the COUNTIF function with the SUM function, structured within the conditional formatting rule engine. The objective of this formula is to check if the contents of the top cell in the selected range (cell A2, in this case) contain any of the text strings listed in our named range, specific_text. If even one criterion is met, the cell should receive the defined formatting.
In the formula entry box within the New Formatting Rule dialog, input the following expression precisely:
=SUM(COUNTIF(A2,"*"&specific_text&"*"))
After entering this sophisticated formula, click the Format… button. This interface allows you to define the visual style applied when the formula returns TRUE (i.e., when one or more criteria are met). You have full control to choose a custom fill color, font style, or border. For demonstration purposes, selecting a light green fill provides clear, non-distracting visual feedback. Once the desired format is chosen, click OK to close the format dialogue, and then OK again to finalize the new rule and apply it to the data.

Deconstructing the Conditional Formatting Logic
Understanding the mechanism behind why the formula =SUM(COUNTIF(A2,"*"&specific_text&"*")) works is crucial for adapting this technique to different analytical needs. In the context of conditional formatting, this formula operates as an implicit array formula, meaning it performs multiple calculations simultaneously without needing explicit array entry (Ctrl+Shift+Enter).
- The inner function, COUNTIF(A2,”*”&specific_text&”*”), acts as the primary criteria checker. Since specific_text refers to a range (D2:D4) and not a single cell, COUNTIF is forced to perform multiple comparisons—one for each cell in the criteria range. For the initial cell A2 (e.g., ‘Starting Point Guard’), it generates an intermediate array result by checking: does A2 contain ‘Starting’? Does A2 contain ‘Forward’? Does A2 contain ‘Center’?
-
Crucially, the wildcard characters (“*”) on both sides of the criteria enable partial matching. The ampersand operator (
&) concatenates the wildcards with each text string in the specific_text range. If A2 contains the text ‘Starting’, the check for that element returns 1 (representing TRUE); otherwise, it returns 0 (representing FALSE). If the criteria list has three items, the result of COUNTIF is a three-element array of 1s and 0s (e.g., {1, 0, 0}). - The outer function, SUM(…), aggregates the results of this array. If the cell A2 contains ‘Starting’, the resulting sum is 1 + 0 + 0 = 1. If it contains ‘Power Forward’ (assuming ‘Forward’ is the second criteria), the sum might be 0 + 1 + 0 = 1. If the cell contains none of the criteria, the sum is 0 + 0 + 0 = 0.
- Finally, Conditional Formatting evaluates the numerical outcome: any non-zero number (1 or greater) is interpreted as TRUE, triggering the formatting. A result of 0 is interpreted as FALSE, and no formatting is applied. This construction effectively creates a powerful, single-rule solution equivalent to a complex OR logic statement across multiple conditions.
Reviewing the Output and Customization Potential
Upon final confirmation, the conditional formatting rule immediately executes across the selected range A2:A11. All cells that contain any of the specified texts (Starting, Forward, or Center) will be highlighted with the chosen format. This instantaneous visual feedback confirms the successful implementation of the multi-criteria rule, demonstrating the power of combined functions in Excel.

This approach is particularly flexible due to the essential use of the named range. If the analysis requirements change—for instance, if management decides to track different positions—you simply update the list in cells D2:D4, and the conditional formatting updates automatically without needing to open or alter the complex formula. For example, suppose we redefine our criteria to focus on different positional components:
- Point
- Shooting
- Power
By simply replacing the text in cells D2:D4 with these new values, the entire rule adapts dynamically. The spreadsheet instantly reflects the new criteria, highlighting positions such as ‘Point Guard’, ‘Shooting Guard’, and ‘Power Forward’.

Note: We chose a light green fill for the conditional formatting in this example to ensure clarity, but users have complete autonomy over the visual styling. The Format button within the New Rule dialogue offers extensive customization options, including specialized font colors, borders, and number formats. Always choose a style that enhances data interpretation without causing visual fatigue. This adaptability makes the formula-based conditional formatting method the premier choice for complex, high-volume data visualization challenges in Excel.
Cite this article
stats writer (2025). How to Conditionally Format Cells Based on Multiple Values: A Simple Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-conditionally-format-based-on-multiple-values/
stats writer. "How to Conditionally Format Cells Based on Multiple Values: A Simple Guide." PSYCHOLOGICAL SCALES, 21 Nov. 2025, https://scales.arabpsychology.com/stats/how-can-i-conditionally-format-based-on-multiple-values/.
stats writer. "How to Conditionally Format Cells Based on Multiple Values: A Simple Guide." PSYCHOLOGICAL SCALES, 2025. https://scales.arabpsychology.com/stats/how-can-i-conditionally-format-based-on-multiple-values/.
stats writer (2025) 'How to Conditionally Format Cells Based on Multiple Values: A Simple Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-conditionally-format-based-on-multiple-values/.
[1] stats writer, "How to Conditionally Format Cells Based on Multiple Values: A Simple Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, November, 2025.
stats writer. How to Conditionally Format Cells Based on Multiple Values: A Simple Guide. PSYCHOLOGICAL SCALES. 2025;vol(issue):pages.
