...
Blog
How to Add Conditional Formatting in Excel and Google Sheets – A Complete Step-by-Step GuideHow to Add Conditional Formatting in Excel and Google Sheets – A Complete Step-by-Step Guide">

How to Add Conditional Formatting in Excel and Google Sheets – A Complete Step-by-Step Guide

Alexandra Blake, Key-g.com
przez 
Alexandra Blake, Key-g.com
13 minut czytania
Blog
grudzień 10, 2025

Start by selecting the entire data range you want to format, with the title row kept visible, then apply conditional formatting. The result is displayed immediately and helps readers spot patterns at a glance. Choose a rule type that matches your goal: color scales for risk levels, data bars for progress, or a single color for required thresholds, and keep the formatting close to the data context.

Across Excel and Google Sheets, set up rules through the same logic. In Excel, go to Strona główna > Conditional Formatting > New Rule; in Sheets, Format > Conditional Formatting. Use the dropdown menus to choose rule types such as Cell is greater than, Text contains, lub Date is. For advanced cases, assemble a dynamic function and test it on a sample row to confirm the outcome. according to your dataset, pick formats that display values quickly and clearly.

Create a sample dataset with columns for date, amount, status, and a checkbox column for done. Apply a rule that highlights amounts above 1000 in green and dates within the last 30 days in yellow. This approach works in both Excel and Sheets, and you can copy the entire rule to other ranges without rewriting the formula. The options you pick should remain consistent to avoid confusion in the entire report.

Advanced tips: use custom formulas to handle complex cases; for example, =AND(A2>0, B2<100) to mark rows where two conditions are met. Use unchecked checkboxes to drive visual cues; you can manage multiple rules so later ones override earlier ones. Apply rules to the entire row by selecting the full range, then ensure the Apply to range matches the context and the card-like layout of your sheet. These techniques uses simple logic to scale with larger datasets.

Power BI integration: after you finalize formatting, export the sheet to powerbi for dashboards or connect the sheet directly. The displayed colors and formats can enrich reports with minimal effort. In powerbi, mirror the sheet rules by applying conditional formatting in visuals, so viewers see a consistent context across tools.

Best practices: name each rule with a clear title to keep the entire document understandable; maintain a single source of truth by ensuring the rules supported across versions; test changes in a sample environment before sharing; include a short context note in a card to guide collaborators and explain why a rule was made.

Practical, hands-on steps to apply conditional formatting across Excel, Google Sheets, and Power BI

Begin with a single, portable rule that you can reuse across Excel, Google Sheets, and Power BI: apply a color gradient to values to surface highlights such as the highest and lowest entries. This simple tool lets you see patterns at a glance and requires no scripting. Set the rule once, then copy the formatting to other ranges to enable consistency across your reports. Use the most common option–a 3-color scale that maps min to red, mid to yellow, max to green–adjusting for your data basis and source quality.

Step 1 – Excel Select the data range you want to format. Go to Home > Conditional Formatting > Color Scales > 3-Color Scale. Choose colors that align with your goal: red for low, yellow for mid, green for high. If your sheet contains blanks or text, Excel will ignore them; verify by selecting Manage Rules and adjusting the Applies To range if needed. For easier reuse, copy the formatted cells or use Format Painter to apply the same rule to adjacent blocks without creating a new rule each time.

Step 2 – Google Sheets In Google Sheets, select the same data range. Open Format > Conditional formatting. In the dialog, set Format cells if to Color scale and assign colors for Min, Mid, and Max (for most scenarios, Min = red, Mid = yellow, Max = green). Use percentile or number thresholds when your data distribution calls for it, and tap Done. This approach remains consistent with Excel, so visuals across sheets stay coherent for readers and stakeholders. If you need to manage many ranges, rely on the Apply to range field to extend the rule across related blocks.

Step 3 – Power BI Within a table or matrix visual, open the Format pane and choose Conditional formatting > Background color (or Font color). Select Format by: Rules, then define thresholds such as: If Value >= 0.8, color = #2ECC71; If Value >= 0.5, color = #F7DC6F; else color = #E74C3C. You can repeat for multiple fields or switch to a DAX approach: ColorCode = IF([Value] >= 0.8, “#2ECC71”, IF([Value] >= 0.5, “#F7DC6F”, “#E74C3C”)). Apply ColorCode to the background to automate consistent visuals. For advanced control, try tools like bardatapointselectionidgetselector to bind colors to specific data points and enable dynamic palettes; you can also enumerateobjectinstancesoptions to explore available formatting options before finalizing your palette.

Next, test across sources by exporting a small sample and validating that the same data basis yields comparable highlights. In Excel and Sheets, confirm that non-numeric cells don’t shift the gradient, and in Power BI, verify that the color scale inherits the same distribution when filters change. If your dataset grows, you can extend the rule by adding a secondary condition (for example, emphasize values above a critical threshold) without overwriting the base gradient.

To keep these steps robust, maintain a single source of truth for thresholds and colors. Document the options you chose, such as min/mid/max colors and whether you used percentiles or absolute values, so the dialogue between readers and visuals stays focused on insights rather than formatting quirks. When you share the report, include a brief note on what the colors represent (highlights, such as top performers or critical risks) and reference the source data that anchors the visualization.

For automation or repeated deployments, consolidate the rules into a reusable template. In Power BI, store the DAX snippet in a dedicated measure and reuse it across visuals; in Excel and sheets, create a named range that holds your color scheme and apply it via conditional formatting rules. This approach is especially helpful when you have multiple dashboards relying on the same visual language and enables teams to compare visuals side by side with a consistent direction and style.

When selecting data subsets, ensure the rule remains representative by maintaining consistent data granularity. If your data contains outliers, consider a percentile-based threshold to avoid overstating extreme values; this keeps visuals readable and avoids overwhelming the audience with harsh color jumps. If you need to switch off the rule temporarily, use the Enable/Disable toggle in each platform’s conditional formatting manager to preserve your base configuration for future sessions.

Overall, use the easiest, most transparent approach first: a gradient that maps data to color, followed by optional rules for emphasis. This foundation supports most visualizations and lets you focus on analysis rather than formatting details. When you scale, rely on the same property options across tools and keep a consistent color language source to guide readers through the data story. If you must adapt, do so with a clear basis and remember that consistency drives comprehension across Excel, Google Sheets, and Power BI, even as data evolves over time.

Excel: Apply a color scale to highlight high and low values

Apply a three-color color scale to the data range to highlight high and low values at a glance.

Open the file and select the cells you want to format, including the title row if you want headers to guide the analysis without changing the data values.

On the Home tab, click Conditional Formatting, then choose Color Scales from the dropdown and pick a 3-Color Scale (commonly Red for low, Yellow for mid, Green for high).

To tailor the scale, click More Rules in the dialogue, set the type for min, mid, and max to Number or Percent, enter the exact values if needed, and choose your colors for each point to create a data-driven, analysis-ready look.

In the New Formatting Rule dialog, review the base range in Applies to and adjust it if your data block changes; use the base range to ensure the colors reflect the correct axis and data structure, whether your file contains a long column or multiple columns.

After applying, the formatting updates automatically as numbers change, keeping reports visually consistent and preventing misreads when values shift below or above prior thresholds; this method supports a fast glance at rank and distribution across the dataset.

Tips: keep the font consistent and avoid confusing color cues by sticking to a single scale across related columns; use the title row and other header information to help readers interpret the color cues without extra dialogue, and test the look on a few samples to confirm it aligns with your analysis-ready content.

Excel: Add data bars and icon sets for quick visual cues

Start by selecting your data range and applying data bars via Home > Conditional Formatting > Data Bars. In the formatting pane, choose a color and set Min to 0 and Max to 100 for percentage data, or use Automatic to let Excel determine the scale. This helps your numbers stand out and provides an at-a-glance view that makes their relative performance easier to assess. Use certain thresholds to frame the visual cues and keep the bars consistent across the sheet.

Next, add icon sets for a quick glance at thresholds: Home > Conditional Formatting > Icon Sets. Choose a 3-icon or 5-icon scheme and switch the rule type to Percentage or Number. Define thresholds (e.g., 0-33, 34-66, 67-100) and map each icon to a range: green for high, amber for mid, red for low. There, you can use value-based cues to orient decisions, which is commonly used in dashboards tracking orders, inventory, or sales. If you want a purely visual cue, select Show Icon Only; otherwise keep the value to provide context. You can also choose other colors beyond the classic red/amber/green if your context requires it.

Fine-tune via the formatting rule pane: adjust priority so data bars render beneath icons or vice versa, ensuring the latter do not obscure numbers. If you need to change the color scale later, it’s easy. Read the detail in the rule pane to capture all options. Use the properties pane to tweak overlap, direction, and gradient versus solid fills. If none of the rules fit your data, delete them or start fresh. For a mixed view, apply a data bar on the left and an icon to the right; this stand demonstrates a useful combination for quick analysis. In maths-based metrics, scale matters: a tight 0-100 scale highlights subtle shifts; a wider 0-1000 range may require different min/max. You can also switch to a 2-icon set for a leaner look when the data is straightforward. This approach, while challenging at first, becomes easier with a clear rule order.

Auditing and print: When reviewing across multiple sheets, enumerateobjectinstances helps you list all conditional formatting rules in a sheet. This gives you a clear overview of their context and properties. Adjust rule order in the pane to guarantee the intended visual priority. For print, ensure the font size and row height preserve legibility; test print the sheet and adjust page layout accordingly. This makes the visual cues useful rather than cluttering the printout.

Step Action Notes
Data Bars Select range; Home > Conditional Formatting > Data Bars; choose color; set Min/Max Use percentage scale when data is percentage; for other data, switch to Number and adjust to your range
Icon Sets Home > Conditional Formatting > Icon Sets; pick 3- or 5-icon set Rule Type: Percentage or Number; map to thresholds; Show Icon Only option if desired
Fine-Tuning Open the rule pane; adjust priority; check the pane; choose gradient or solid Detail matters; ensure none of the rules obscure values
Audit & Print Use enumerateobjectinstances to list rules; preview print There are none left unclear; ensure legibility on print

Google Sheets: Create rules for dates, numbers, and text

Choose the range containing dates, numbers, and text, then add three targeted conditional-formatting rules to format each type distinctly.

Dates: use the built‑in date checks or a custom formula. For example, to highlight dates within the next 7 days, set a custom formula and apply across the range starting at the top-left cell, e.g. =A2 <= TODAY() + 7 and A2 <> “”. Displayed cells will stand out with a grey fill, making upcoming deadlines easy to spot without extra effort. This rule can be extended to adjacent columns with the same logic, so you can cover very large ranges effortlessly.

Numbers: apply a rule such as greater than a threshold or between a range. Example: highlight numbers above 100 in B2:B100 with a simple formula =B2 > 100, then choose a subtle fill. For a window check, use =AND(B2 >= 0, B2 <= 50) to flag values that fall inside a certain band. These maths-backed checks help you identify outliers against your main data set without manual scanning.

Text: filter by content using Text contains or a custom formula. Example: highlight cells in C2:C100 that include urgent or ASAP with a formula =REGEXMATCH(C2, “(?i)urgent|ASAP”). You can also detect patterns starting with a prefix by using a different rule, which keeps the presentation useful and clear. The resulting formatting serves as graphics-style cues next to the data, guiding readers where action is needed.

Tips: apply each rule to the full columns and ensure the top-left cell reference stays correct so the logic remains accurate as data grows. The approach isnt dependent on scripts, and the accepted patterns align with common data hygiene practices. When you need to indicate multiple conditions, a separate rule per data type helps you find and manage items quickly, and the resulting visuals keep the range organised and very readable.

Google Sheets: Use custom formulas to flag duplicates and outliers

Google Sheets: Use custom formulas to flag duplicates and outliers

Apply a color-based duplicate flag by selecting the data range (for example A2:A1000), open Format > Conditional formatting, choose Custom formula is, and enter =COUNTIF($A:$A, A2)>1. Set a vivid color to indicate duplicates. For broader coverage, add a dropdown to choose the target column and copy the rule to the corresponding range; this will work across a data matrix and scale as rows grow. The output shows the flagged points and corresponds to the actual values in the dataset, making duplicates easy to spot against the full column.

To flag outliers, use a value-based rule. In conditional formatting for the same range, enter =ABS((A2-AVERAGE($A$2:$A$1000))/STDEV.P($A$2:$A$1000))>2. This highlights points with negative or high deviations beyond two standard deviations. Adjust the threshold to 1.5 or 3 depending on the metrics and distribution. Apply a different color-based style to distinguish outliers from duplicates. The matrix now shows two layers of flags, and you can export the output as an array or build a compact summary for analysis.

Workflow and integration tips: import data from external sources, keep a separate sheet with named ranges for stability. Use a dropdown to select a column and drive the analysis. The results will indicate how many duplicates and outliers exist in the selected subset, and you can generate a compact output matrix for reporting. For practical notes, ensure the data are numeric for the outlier formula and update ranges as data grows. This approach supports scale and provides clear, actionable metrics across your dataset.

Power BI: Apply conditional formatting to tables, matrices, and visuals with DAX

Create a color measure named StatusColor to drive conditional formatting across tables, matrices, and charts. This rules-based approach will highlight critical values, support quick analysis, and keep visuals consistent across cards, charts, and axis labels in powerbi.

  1. Define the needs and thresholds
  2. Identify the values that matter for your analysis: performance bands, risk levels, or targets. Use a small set of clear colors to avoid confusion and ensure that the statuscolor logic remains high-performing and easy to maintain.

  3. Write the DAX measure
  4. Sample DAX you can start with:

    StatusColor = SWITCH(TRUE(),

    [Value] >= 100000, “#1a9641”,

    [Value] >= 50000, “#fdae61”,

    [Value] >= 10000, “#f44336”,

    “#d3d3d3” )

    Notes: you can add a NONE path for rows that shouldn’t highlight, effectively keeping a neutral background when needed. Those rules will be shown in the visual as a default color, which helps keep the focus on critical spots.

  5. Apply to tables and matrices
  6. Open the visual’s formatting pane, choose Conditional formatting, then set Background color (or Font color) to Format by: Field value and pick StatusColor. This will apply the color from the measure to each row or cell, enabling you to spot hotspots across a hierarchy of rows and columns.

  7. Extend to charts and other visuals
  8. For charts, use Data colors and set Format by: Field value, selecting StatusColor. If you work with a hierarchy, Power BI will carry the colors through the levels, helping you maintain a consistent analysis narrative across those series.

  9. Validate accessibility and maintainability
  10. Test with different slices to verify that the colors convey the intended status at a glance. Keep the palette distinct enough for axis labels and backgrounds so the chart remains readable in close-up analysis. If colors look muted, tweak the hex codes to increase contrast while keeping the same intent.

Additional tips to maximize impact:

  • Use a few carefully chosen colors to keep the rule set clear and avoid chart clutter.
  • Leverage a neutral default for none or ordinary values so that only critical changes stand out.
  • Document the thresholds in your model properties so those who review the dashboard understand the logic behind statuscolor.
  • Apply the same StatusColor measure to axis-related visuals when you want a unified signal across the analysis.
  • Test performance with large row counts; the measure will run per value, but keeping the logic simple preserves responsiveness.
  • Remember that you can combine this approach with drill-throughs and hierarchy visuals to spotlight the most relevant spots during close analysis.

Whether you’re tracking sales performance, operational metrics, or financial indicators, this approach will show you where attention is needed and where outcomes are strong. It isn’t about one-off highlighting; it’s about creating a cohesive, rules-based color system that supports high-level intelligence across your reports. Use StatusColor to spot trends, declinations, or status shifts at a glance, and you’ll deliver a high-performing experience that resonates with stakeholders who rely on clear, consistent visuals in powerbi.