Learning to Use Conditional Formatting Between Two Values in Google Sheets


The ability to quickly interpret vast amounts of data is paramount in modern analysis. Google Sheets provides sophisticated mechanisms for data visualization, chief among them being conditional formatting. This dynamic feature allows users to automatically apply specific visual styles—such as color changes or bolding—to cells that meet predefined criteria. While Sheets offers several built-in rules, leveraging the custom formula option unlocks unparalleled power, enabling complex, logical evaluations.

Specifically, this guide focuses on using a custom formula to highlight cells whose numerical content falls precisely within a defined upper and lower threshold. This technique is invaluable for segmenting performance tiers, managing inventory levels, or identifying data points that require immediate attention. We will provide a formal, step-by-step walkthrough demonstrating how to apply this range-based conditional formatting rule, ensuring clarity and precision throughout the process.

The Power of Conditional Formatting in Data Analysis

Conditional formatting fundamentally transforms raw spreadsheet data into actionable visual insights. Instead of manually scanning hundreds of rows for specific values, rules automate the identification of patterns, outliers, or items meeting critical criteria. This automation significantly enhances the efficiency of data review, making spreadsheets more intuitive and responsive for immediate analysis.

The true flexibility of this feature emerges when utilizing the custom formula option. Standard, built-in rules cover simple comparisons (e.g., greater than, equal to), but they often fall short when multiple, interdependent criteria must be met simultaneously. For instance, highlighting a value that must be both above X and below Y requires a logical compound statement, which is precisely what the custom formula provides.

To successfully apply range-based formatting, we must employ the AND function. This logical function in Google Sheets evaluates multiple logical expressions and returns TRUE only if all conditions within its parameters are met. By structuring a formula that checks the lower boundary condition and the upper boundary condition concurrently, we can precisely target the desired numerical range for visualization.

Setting Up Your Data for Conditional Formatting

To illustrate this technique, we will use a straightforward fictional dataset representing sports team performances. This common scenario requires identifying teams whose accumulated points fall within a specific performance bracket—for example, the “average” tier or the “needs improvement” tier. Our dataset includes a “Team” column (Column A) and a “Points” column (Column B).

The objective is clear: we want to visually tag the team names (in Column A) whenever their corresponding score in Column B is between 12 and 20, inclusive. This range selection allows managers or analysts to quickly isolate a particular segment of performance without having to manually sift through the entire score list.

Review the sample dataset below. Note that the formatting rule will be applied to the text in column A, but the condition will be evaluated based on the numerical values present in column B.

Applying Conditional Formatting Between Two Values: A Step-by-Step Guide

This procedure requires precise selection of the target range and careful input of the logical formula. Our goal is to highlight cells in Column A if the corresponding value in Column B is greater than or equal to 12 AND less than or equal to 20. Follow these steps meticulously:

  1. First, define the area where the visual change will occur. Select the range A2:A11. It is critical to select the range where the formatting is applied (Team names), even though the condition relies on an adjacent column (Points).

  2. Access the formatting options by navigating to the menu bar. Click Format, and then select Conditional formatting. This action will open the “Conditional format rules” sidebar on the right side of the spreadsheet interface.

  1. In the “Conditional format rules” panel, scroll to the “Format cells if…” dropdown menu. Select the option labeled Custom formula is. This prepares the rule to accept a logical expression that dictates the formatting criteria.

  2. In the formula input box, enter the following precise expression:

    =AND(B2>=12, B2<=20)

    This formula uses the AND function to enforce both the minimum and maximum conditions simultaneously. It checks that the score in cell B2 is greater than or equal to 12, AND that the score is less than or equal to 20.

    Crucially, because we selected the range A2:A11, the formula uses a relative cell reference, B2. Google Sheets automatically adjusts this reference as it moves down the range. Thus, the formatting for A3 will be evaluated against B3, A4 against B4, and so on, ensuring the rule correctly applies row-by-row correlation.

Google Sheets conditional formatting between two values

Interpreting Results and Customizing Appearance

Upon inputting the custom formula and clicking Done, the conditional formatting rule is instantly applied. You should observe that only the team names corresponding to scores between 12 and 20 (inclusive) are highlighted, providing immediate visual confirmation of the data segmentation.

While Google Sheets defaults to a light green background for new rules, the Formatting style box offers extensive customization. Analysts should leverage this feature to enhance report clarity. Options include changing the fill color, adjusting text color, applying bold or italic styles, or even using custom font styles. Choosing a distinct style ensures the highlighted data stands out effectively within the broader context of the dataset.

Effective customization involves selecting colors that align with the meaning of the data—for example, using amber for “mid-range performance” or red for “critical threshold.” This visual language is essential for creating high-impact dashboards and reports where quick interpretation is necessary.

Common Use Cases and Best Practices

The ability to format cells based on values falling within a specific numerical range has broad applicability across various professional domains. Beyond simple score tracking, this technique streamlines complex analytical processes. Key use cases include:

  • Inventory Management: Highlighting stock levels that are situated between a minimum reorder point and a maximum capacity threshold, signaling optimal attention for replenishment planning.

  • Financial Analysis: Identifying expenses or revenue streams that fall within a budgeted variance range, allowing focus on acceptable deviations rather than extreme outliers.

  • Project Management: Marking tasks based on risk scores (e.g., medium risk) or progress completion percentages (e.g., tasks 50% to 75% complete).

  • Educational Grading: Automating the categorization of student performance by instantly visually grouping scores that correspond to specific letter grades (e.g., scores yielding a ‘B’).

When managing complex spreadsheets with multiple conditional formatting rules, maintaining order and structure is vital. Adhere to these best practices:

  • Prioritize Rules: Remember that rules are executed sequentially, from top to bottom, in the “Conditional format rules” panel. If two rules apply to the same cell, the one listed higher takes precedence. Always order your rules logically to achieve the desired outcome.

  • Enhance Readability with Named Ranges: For extensive or frequently referenced ranges, define a named range. Using descriptive names in your formulas instead of cryptic cell coordinates (e.g., Points_Column instead of B2:B100) significantly improves formula legibility and management.

  • Validate the Formula: Before applying complex rules to an entire dataset, test the custom formula on a small, representative subset of data. This ensures the logical expression yields the correct TRUE/FALSE result under various conditions.

Troubleshooting Advanced Cell References

While the structure of the formula AND(B2>=12, B2<=20) appears simple, errors often arise from mismanaging the application range or misunderstanding cell references. Correct setup is paramount for successful implementation.

  • Verifying Range Application: Always confirm that the “Apply to range” setting accurately reflects the cells you intend to format. If you want to color the team names in column A, the range must be A2:A11. If you mistakenly set the range to B2:B11, the scores themselves, rather than the corresponding team names, will be highlighted.

  • Understanding Relative vs. Absolute References: For column-wide conditional formatting based on values in the same row (as demonstrated here), the use of a simple relative cell reference, such as B2 without dollar signs, is correct. However, if your rule needed to check every row against a single fixed target value located, for example, in cell B1, you would need to use an absolute reference like $B$1 to prevent the reference from shifting row by row.

  • Formula Syntax Errors: Any formula used for conditional formatting must resolve to a simple Boolean TRUE or FALSE result. Carefully check for common errors like misplaced commas, mismatched parentheses, or incorrect logical operators (e.g., using > instead of the required inclusive operator >=).

For extremely nuanced visualization needs, the flexibility of the AND function allows for nesting with other logical functions, such as OR or NOT. This advanced combination enables the creation of rules that identify data points meeting a range criteria while simultaneously excluding data points based on a third condition, pushing the boundaries of automated data analysis in Google Sheets.

Conclusion and Further Resources

Mastering the application of range-based conditional formatting using a custom formula is an essential skill for any proficient spreadsheet user. This method provides immediate, impactful visual feedback, transforming raw numbers into meaningful tiers and categories. We highly encourage experimentation with the logical operators and cell referencing techniques discussed here to unlock the full potential of your data visualization efforts.

To further enhance your mastery and explore adjacent advanced functions, consider these authoritative resources:

  • Official Google Support documentation detailing all aspects of Conditional Formatting rules.

  • Guides focusing on complex logical operations, including nested uses of the AND, OR, and IF functions.

  • Tutorials specializing in advanced techniques for managing cell referencing and the implementation of named ranges.

These materials will provide the foundation necessary to tackle increasingly complex data analysis challenges within the spreadsheet environment.

Cite this article

Mohammed looti (2025). Learning to Use Conditional Formatting Between Two Values in Google Sheets. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/google-sheets-conditional-formatting-between-two-values/

Mohammed looti. "Learning to Use Conditional Formatting Between Two Values in Google Sheets." PSYCHOLOGICAL STATISTICS, 26 Oct. 2025, https://statistics.arabpsychology.com/google-sheets-conditional-formatting-between-two-values/.

Mohammed looti. "Learning to Use Conditional Formatting Between Two Values in Google Sheets." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/google-sheets-conditional-formatting-between-two-values/.

Mohammed looti (2025) 'Learning to Use Conditional Formatting Between Two Values in Google Sheets', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/google-sheets-conditional-formatting-between-two-values/.

[1] Mohammed looti, "Learning to Use Conditional Formatting Between Two Values in Google Sheets," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, October, 2025.

Mohammed looti. Learning to Use Conditional Formatting Between Two Values in Google Sheets. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.

Download Post (.PDF)
Scroll to Top