How to Apply Conditional Formatting to Imported CSV Data in Excel
To apply conditional formatting to imported CSV data, select the range (or better, the Excel Table column), go to Home > Conditional Formatting, and add rules: Highlight Cells Rules for thresholds, Color Scales for gradients, Data Bars for in-cell charts, Icon Sets for status symbols. Raw imported data is a wall of numbers; conditional formatting turns it into a picture — overdue items glow red, top performers shine green, outliers jump out before you go looking for them. (Starting from scratch? The free CSV to Excel converter builds the workbook first.)
The Five Rule Types (And When to Use Each)
Highlight Cells Rules — thresholds
The workhorse. Select the Amount column > Conditional Formatting > Highlight Cells Rules > Greater Than > 10000, pick red fill. Typical uses:
- Due dates before TODAY() → red (overdue)
- Amounts over budget → red; under → green
- Duplicate values in an ID column → flag before analysis (pairs with the duplicates guide)
Color Scales — gradients
Select a numeric column > Color Scales > Green-Yellow-Red. Every cell gets a background shade proportional to its value — the column becomes a heatmap. Best for spotting distribution at a glance: which regions, products, or days dominate.
Data Bars — in-cell bar charts
Select the column > Data Bars > pick a color. Each cell grows a bar proportional to its value. Data bars keep the numbers visible (unlike color scales, which can obscure them) while adding the visual comparison.
Icon Sets — status symbols
Select a status or rating column > Icon Sets > 3 Arrows (or traffic lights). Map icons to value ranges in Manage Rules: green for on-track, yellow for at-risk, red for overdue. Dashboards love icon sets.
Top/Bottom Rules — rankings
Top 10 Items, Bottom 10%, Above Average — one click each. "Highlight the top 10 customers by revenue" is literally Top 10 Items on the revenue column.
| Goal | Rule type |
|---|---|
| Flag overdue / over-budget | Highlight Cells Rules |
| See distribution at a glance | Color Scales |
| Compare magnitudes, keep numbers | Data Bars |
| Status dashboards | Icon Sets |
| Rankings | Top/Bottom Rules |
Formulas as Rules (Full Control)
New Rule > "Use a formula to determine which cells to format" unlocks everything. Select the data range first (say A2:D500), then write the formula relative to the active cell:
- Entire row red when overdue:
=$C2<TODAY()(lock the column with$, leave the row relative) - Highlight weekends in a date column:
=WEEKDAY($A2,2)>5 - Flag amounts 20% above the column average:
=B2>AVERAGE($B$2:$B$500)*1.2 - Alternate banding that survives sorting:
=MOD(ROW(),2)=0(use a Table's built-in banded rows instead — simpler)
The $ placement is the whole skill: $C2 locks the column so each cell in the row checks column C; C$2 would check only row 2. Get this wrong and the formatting lands on random cells.
Rules That Survive Refresh
Imported data gets replaced; formatting should not die with it. Defenses:
- Apply rules to the Table column, not a fixed range. Select the Table column (click its header) before creating the rule — the "Applies to" becomes the structured reference and grows with new rows.
- Use Manage Rules to audit. Conditional Formatting > Manage Rules shows every rule, its range, and its order. Rules apply top-down; tick "Stop If True" to prevent lower rules firing on already-formatted cells.
- Avoid absolute ranges like
$B$2:$B$250in "Applies to" — next month's 400-row file leaves 150 rows unformatted.
Common Mistakes
- Formatting the header row. Exclude row 1 from the selection, or the header gets colored like data. Table-column selection handles this automatically.
- Rule explosion. Copy-pasting formatted cells fragments one rule into dozens ("Applies to" becomes a patchwork). Periodically open Manage Rules, delete fragments, and re-apply cleanly.
- Color scales on text. They need numbers. A text column of statuses gets nothing from a color scale — use Icon Sets or Highlight Cells Rules instead.
- Too many colors. Three meanings max per sheet (good/bad/neutral). A rainbow workbook communicates nothing.
Formatting Based on Another Column
The most useful conditional formats look at one column and color another — or the whole row:
Status-driven row colors. Select the data range A2:D500, New Rule > formula: =$C2="Overdue" → red fill; add a second rule =$C2="Due soon" → yellow. The $C locks the status column; every cell in the row follows it. Sort the sheet however you like — the colors track the status, not the position.
Variance highlighting. Budget in C, actual in D: formula =$D2>$C2*1.1 colors rows 10% over budget. The multiplier is visible in the rule — change 1.1 to 1.2 when the tolerance changes, no formula surgery across cells.
Cross-sheet benchmarks. =B2>AVERAGE(Benchmarks!$A$2:$A$50) highlights values beating an external benchmark table. Keep the benchmark range absolute ($A$2:$A$50) so every cell compares against the same reference.
Managing rule collisions. When several formula rules could hit the same row, order them in Manage Rules from most specific to most general, and tick Stop If True on the specific ones — an "Overdue" row should not also get the "Due soon" treatment. Test collisions deliberately: craft a row that triggers two rules and confirm the right one wins.
Performance note for cross-column rules. Formula rules referencing other columns recalculate with the sheet. On Tables past ~100k rows, keep the formulas simple (comparisons, not nested lookups) or move the logic into a helper column with a plain value ("Overdue"/"OK") and point a simple Highlight Cells rule at it. The helper column computes once per row; the format rule just reads it — dramatically cheaper than a lookup inside every format evaluation.
FAQ
Why did my formatting disappear after refreshing the import?
The rule's "Applies to" range pointed at the old rows. Apply rules to the Table column (structured reference) so the range grows with the data.
Can I highlight an entire row based on one column?
Yes: select the full data range, create a formula rule like =$C2<TODAY(), and set the format. The $ locks the checked column; the relative row lets each row evaluate itself.
How do I remove all conditional formatting?
Select the range (or the sheet) > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells / Entire Sheet. For surgical removal, delete individual rules in Manage Rules.
Do conditional formats print?
Yes, by default — colors, bars, and icons all print. Check Print Preview: light color scales can wash out on paper; darken them or switch to data bars for print-heavy reports.
Will conditional formatting slow down a big sheet?
Color scales and data bars over hundreds of thousands of cells add recalculation cost. For very large Tables, prefer a helper column with a simple flag formula plus one Highlight Cells rule over heavy gradient rules.
Final Checklist
- Rules applied to Table columns (structured references), not fixed A1 ranges.
- Rule order audited in Manage Rules; Stop If True set where rules overlap.
- Headers excluded; at most three color meanings per sheet.
- A refresh test: new rows inherit the formatting automatically.
- Print preview checked if the sheet goes to paper.
If all five checks pass, your imported data now speaks in color — the important rows find the reader, not the other way around.