🎯 Mục tiêu bài học
Sau bài học này, bạn sẽ:
✅ Sử dụng Highlight Cell Rules cho values, duplicates, dates
✅ Tạo Data Bars và Color Scales cho heatmap analysis
✅ Áp dụng Icon Sets (traffic lights, arrows, stars) cho KPIs
✅ Viết Formula-based rules cho custom formatting
✅ Quản lý rule priority và Stop If True
Thời gian: 30 phút | Độ khó: Intermediate | Yêu cầu: Hoàn thành Bài 4 - Charts
📖 Bảng Thuật Ngữ Quan Trọng
| Thuật ngữ | Tiếng Việt | Mô tả |
|---|---|---|
| Conditional Formatting | Định dạng có điều kiện | Tự động đổi format dựa trên giá trị |
| Highlight Cell Rules | Quy tắc tô sáng ô | Rules cho greater/less than, duplicates |
| Data Bars | Thanh dữ liệu | Thanh visual so sánh trong cell |
| Color Scales | Thang màu | Gradient color từ thấp đến cao |
| Icon Sets | Bộ biểu tượng | Traffic lights, arrows, stars |
| Heatmap | Bản đồ nhiệt | Bảng sử dụng color scale |
| Formula-Based Rule | Quy tắc công thức | Custom rule dùng formula |
| Rule Priority | Thứ tự ưu tiên | Rules trên được áp dụng trước |
| Stop If True | Dừng nếu đúng | Ngừng check rules tiếp khi match |
| Duplicate Values | Giá trị trùng lặp | Tìm và highlight data bị trùng |
Checkpoint
Conditional Formatting tự động đổi format. 5 loại chính: Highlight Rules, Data Bars, Color Scales, Icon Sets, Formula-based. Bạn biết khi nào dùng loại nào chưa?
💡 1. Conditional Formatting là gì?
Conditional Formatting tự động thay đổi format cells dựa trên giá trị hoặc điều kiện.
- 🔴🟡🟢 Traffic lights cho KPIs
- 📊 Data bars cho so sánh visual
- 🎨 Color scales cho heatmaps
- ⚡ Instant insights không cần charts
Conditional Formatting vs Charts: CF hiển thị trực tiếp trên data table — không cần tạo chart riêng. Lý tưởng cho dashboards compact và executive reports.
Checkpoint
Conditional Formatting tự động format cells dựa trên giá trị. Ưu điểm: insights ngay trên data mà không cần tạo chart riêng. Bạn đã dùng CF bao giờ chưa?
🔍 2. Highlight Cell Rules
Home → Conditional Formatting → Highlight Cells Rules
2.1 Greater Than / Less Than
Rule: Greater Than → 50000Format: Green Fill + Dark Green Text| Region | Revenue | Highlight |
|---|---|---|
| North | 65,000 | 🟢 Green |
| South | 38,000 | |
| East | 52,000 | 🟢 Green |
| West | 41,000 |
2.2 Between / Text Contains
Between → 30000 and 50000Warning zone → Yellow FillText Contains → "Urgent"Urgent tasks → Red Fill2.3 Duplicate Values
Duplicate Values → Red FillUnique Values → Green Fill2.4 Date Rules
Yesterday → Redoverdue!This Week → Yellowcoming upNext Week → GreenplannedDuplicate Values rule chỉ so sánh trong range được chọn. Nếu muốn tìm duplicates across 2 sheets → dùng COUNTIF formula-based rule thay thế.
Checkpoint
5 loại Highlight Rules: Greater/Less Than, Between, Text Contains, Duplicate Values, Date Rules. Thường dùng nhất: Greater Than cho revenue targets, Duplicates cho data cleaning. Bạn đã thử chưa?
📊 3. Data Bars & Top/Bottom Rules
3.1 Top/Bottom Rules
Top 10 Items → Green highlightBottom 5% → Red highlightAbove Average → GreenBelow Average → Red3.2 Data Bars
Visual bars inside cells — so sánh nhanh không cần chart.
Data Bars — Visual comparison trong cells
| Region | Performance | Value |
|---|---|---|
| North | 95K | 95K |
| East | 75K | 75K |
| South | 60K | 60K |
| West | 45K | 45K |
| Central | 25K | 25K |
3.3 Customize Data Bars
- Min/Max type: Number, Percent, Percentile
- Negative Values: Red bars
- Show bar only: Hide numbers, bar fills entire cell
Budget Used: 80%│████████│ Green bar ✅Budget Used: 105%│██████████│ Red bar - over budget! ❌"Show bar only" tạo mini bar chart trong cell — rất hiệu quả cho dashboard. Kết hợp với cột giá trị bên cạnh để vừa có visual vừa có số chính xác.
Checkpoint
Top/Bottom Rules highlight performers. Data Bars tạo mini bar charts trong cells. Gradient vs Solid fill tùy style. Customize được min/max, negative values. Bạn đã thử show bar only chưa?
🎨 4. Color Scales & Heatmaps
4.1 2-Color Scale
| 25K | 38K | 45K | 62K | 78K |
|---|---|---|---|---|
| 🔴 | 🟠 | 🟡 | 🟢 | 🟢 |
Low (Red) ←── High (Green)
4.2 3-Color Scale
| 45 | 60 | 75 | 85 | 95 |
|---|---|---|---|---|
| 🔴 | 🟠 | 🟡 | 🟢 | 🟢 |
Low (Red) ←─ Mid (Yellow) ─→ High (Green)
4.3 Heatmap Table
Ứng dụng kinh điển — Revenue by Region × Month:
Heatmap — Color Scale 3 màu
| Jan | Feb | Mar | Apr | May | |
|---|---|---|---|---|---|
| North | 85K | 78K | 62K | 88K | 92K |
| South | 55K | 48K | 65K | 72K | 58K |
| East | 32K | 55K | 78K | 60K | 45K |
| West | 68K | 35K | 42K | 58K | 75K |
💡 East yếu Q1 (32K), West yếu Feb (35K) — instant pattern recognition!
Insight tức thì: East yếu nhất Q1, West yếu Feb.
Heatmap là visualization mạnh nhất khi cần scan pattern trong bảng lớn. Một cái nhìn → thấy ngay vùng mạnh/yếu. Stakeholders rất thích format này!
Checkpoint
2-Color Scale cho đơn giản, 3-Color Scale cho chi tiết hơn. Heatmap = Color Scale áp dụng cho bảng 2 chiều → instant pattern recognition. Bạn đã tạo heatmap đầu tiên chưa?
🚦 5. Icon Sets
6.1 Traffic Lights
| Threshold | Icon |
|---|---|
| ≥67% | 🟢 Green |
| ≥33% | 🟡 Yellow |
| <33% | 🔴 Red |
6.2 Arrows & Stars
| Type | Condition | Icon |
|---|---|---|
| Arrows | Tăng (≥5%) | ▲▲ |
| Arrows | Giữ (-5% to 5%) | ► |
| Arrows | Giảm (< -5%) | ▼ |
| Stars | 90-100 | ★★★★★ |
| Stars | 50-69 | ★★★☆☆ |
| Stars | 0-29 | ★☆☆☆☆ |
6.3 Custom Icon Rules
More Rules → Icon Sets → Custom thresholds:
Icon Sets — KPI Dashboard
| Status | KPI | Value | Trend |
|---|---|---|---|
| 🟢 | Revenue Growth | +15% | ▲ |
| 🟡 | Customer NPS | 72 | ► |
| 🔴 | Churn Rate | 8.5% | ▼ |
| ⭐ | Satisfaction | 4.2/5 | ★★★★☆ |
🟢🟡🔴 Traffic Lights — ngôn ngữ chung, ai cũng hiểu!
Traffic lights là "ngôn ngữ chung" của business. 🟢🟡🔴 ai cũng hiểu ngay. Dùng cho KPI dashboards, executive reports — không cần giải thích!
Checkpoint
Traffic Lights (🟢🟡🔴) cho status, Arrows (▲►▼) cho trend, Stars cho rating. Custom thresholds để fit business logic. Bạn đã áp dụng cho KPI report chưa?
📐 6. Formula-Based Rules
6.1 Highlight Entire Row
=$E2="Overdue"Formula ruleApply to: =$A$2:$F$100Format: Red fill6.2 Alternating Row Colors
=MOD(ROW(),2)=0Zebra stripesFormat: Light gray fill6.3 Highlight Weekends / Compare Columns
=OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7)Weekends → Blue fill=B2<C2Actual < Target → Red fillFormula-based rules cần chú ý $ references! Column lock ($E2) giữ cố định cột, row unlocked để check từng dòng. Sai reference = rule áp dụng sai cells — hãy test trên vài rows trước!
Checkpoint
Formula-based rules = CF mạnh nhất — highlight cả row, zebra stripes, so sánh columns. Key: dùng $E2 (lock column, unlock row). Bạn đã tạo rule highlight entire row chưa?
🛡️ 7. Managing Rules
Rules Manager
Home → Conditional Formatting → Manage Rules
📋 Conditional Formatting Rules Manager
| Rule (Applied in =$A$1:$F$100) | Format | Stop If True | |
|---|---|---|---|
| 1 | Cell Value > 90 | 🟢 Green Fill | ☐ |
| 2 | Cell Value 50–90 | 🟡 Yellow Fill | ☐ |
| 3 | Cell Value < 50 | 🔴 Red Fill + Bold | ☑ |
| 4 | =$E2="Overdue" | 🟣 Entire Row Red | ☐ |
⬆ Drag to reorder priority · ☑ Stop If True ngừng check rules bên dưới
- Rules áp dụng từ trên xuống dưới
- Rules trên có priority cao hơn
- Stop If True: Ngừng check rules tiếp nếu match
- Clear Rules: Clear Selected Cells hoặc Entire Sheet
Checkpoint
Rules áp dụng top-down (trên trước). Stop If True ngừng check khi match. Dùng Manage Rules để xem/sắp xếp/xóa tất cả rules. Bạn đã kiểm tra Rules Manager chưa?
🏋️ 8. Thực hành
Kết hợp nhiều loại CF trên cùng bảng data. Hãy thử tạo KPI dashboard!
Exercise 1: Sales Performance Heatmap
Tạo bảng Revenue by Product × Month với:
- Color Scale cho values
- Icon Set cho Growth % column
- Data Bars cho Total column
- Highlight top 3 cells Green, bottom 3 Red
Exercise 2: KPI Dashboard
| KPI | Value | Target | Status |
|---|---|---|---|
| Revenue | 125K | 100K | ▲ 🟢 |
| Costs | 85K | 80K | ▼ 🔴 |
| NPS | 78 | 75 | ► 🟢 |
Apply: Traffic lights cho Status, Data bars cho Value, Formula rule: Red nếu Costs > Target
Checkpoint
Bạn đã apply được Highlight Rules, Data Bars, Icon Sets và Formula-based rule trong các bài tập chưa? KPI Dashboard có hiển thị đúng traffic lights không?
� 9. Tổng Kết
Kiến thức đã học
| Chủ đề | Nội dung chính | Tầm quan trọng |
|---|---|---|
| Highlight Rules | Greater/Less, Duplicates, Dates | Data cleaning & monitoring |
| Data Bars | Mini bar charts trong cells | Quick visual comparison |
| Color Scales | 2/3-Color gradient heatmaps | Pattern recognition |
| Icon Sets | Traffic lights, arrows, stars | KPI dashboards |
| Formula Rules | Custom logic, highlight rows | Advanced analysis |
| Managing Rules | Priority, Stop If True, Clear | Maintainability |
Câu hỏi tự kiểm tra
- Data Bars và Color Scales khác nhau thế nào?
- Khi nào cần dùng Formula-based rule thay vì built-in rule?
- "Stop If True" trong Manage Rules có tác dụng gì?
- Icon Sets phù hợp cho loại dữ liệu nào?
Bài tiếp theo: Data Validation & Protection — Drop-downs, input rules, bảo vệ worksheet
Key Takeaways:
- Highlight Rules: Greater/Less, Duplicates, Dates — data cleaning & monitoring
- Data Bars = mini bar charts trong cells cho visual comparison nhanh
- Color Scales = gradient heatmaps cho pattern recognition
- Icon Sets = traffic lights, arrows — lý tưởng cho KPI dashboards
- Formula-based rules cho custom logic nâng cao
- Conditional Formatting giúp data "tự nói" — thấy ngay outlier, trend, và KPI!
