logo
Microsoft Excel - Interview Questions and Answers
How do you apply conditional formatting in Excel?

Conditional Formatting allows you to highlight cells based on specific conditions, making it easier to visualize data trends.

Steps to Apply Conditional Formatting
  1. Select the Data Range
    • Highlight the cells you want to format (e.g., A1:A10 or A1:D10).
  2. Open Conditional Formatting
    • Go to the Home tab.
    • Click Conditional Formatting in the Styles group.
  3. Choose a Rule Type
    • Highlight Cell Rules (e.g., greater than, less than, equal to).
    • Top/Bottom Rules (e.g., top 10 values, bottom 10%).
    • Data Bars (creates a bar inside the cell based on values).
    • Color Scales (gradient colors based on high/low values).
    • Icon Sets (adds arrows, checkmarks, or other symbols).
  4. Set the Condition and Formatting
    • Choose a condition (e.g., "greater than 50").
    • Select the formatting style (e.g., bold text, red fill).
    • Click OK to apply.

Example 1: Highlight Cells Greater Than a Value
  1. Select A1:A10.
  2. Click Conditional FormattingHighlight Cell RulesGreater Than.
  3. Enter 50, choose a formatting style, and click OK.

Example 2: Apply a Color Scale for Visual Comparison
  1. Select A1:A10.
  2. Click Conditional FormattingColor Scales.
  3. Choose a 3-color scale (e.g., red for low, yellow for mid, green for high).

Example 3: Use a Formula for Custom Formatting

You can use a formula to apply formatting dynamically.

Highlight Cells Where Value is Greater than Average
  1. Select A1:A10.
  2. Click Conditional FormattingNew RuleUse a Formula to Determine Which Cells to Format.
  3. Enter the formula:
    =A1>AVERAGE($A$1:$A$10)
    
  4. Click Format, choose a color, and click OK.

How to Remove Conditional Formatting
  • Select the formatted range.
  • Go to Conditional FormattingClear RulesClear Rules from Selected Cells.