top of page

You are learning Conditional Formatting in MS Excel

Can I use conditional formatting to format cells based on cell borders or shading?

No, conditional formatting in Excel cannot directly format cells based on their existing borders or shading. Conditional formatting works by applying formatting (font style, fill color, borders, etc.) to cells that meet certain criteria you define. These criteria can involve the cell's value, text content, formatting of other cells, formulas, or data bars.

However, you can achieve a similar effect by using a combination of conditional formatting and cell formatting:

1. Set the desired border or shading for your target format. Format the cells you want to conditionally apply the border/shading to with your preferred border style and fill color.
2. Create a conditional formatting rule based on your criteria. Define the conditions that will determine which cells receive the formatting. This could be based on cell values, formulas, or other factors.
3. Apply the pre-defined border/shading format. Within the conditional formatting rule, choose the formatting options and select the format you created in step 1 (with the desired border/shading).

By doing this, only cells meeting the conditional formatting criteria will receive the formatting, which includes the pre-defined border and shading you established.

Here are some alternative approaches to consider:

* Use filters instead of conditional formatting: If you simply want to visually distinguish cells based on their existing borders or shading, you can use filters. Filtering allows you to isolate cells with specific formatting characteristics, making them visually distinct.
* Create a custom formatting rule based on a formula: While conditional formatting can't directly target borders, you can create a custom formula that checks for specific border or shading properties and apply formatting based on the results. This approach requires knowledge of VBA or advanced Excel formulas.

bottom of page