• Excel Video Tutorials

How to border cells based on cell values in Excel?

In Excel, the lines that make it up a cell's border are referred to as boxes. By maintaining borders, we are able to frame any data and give it a defined boundary in an appropriate manner. You can highlight specific values by outlining summarized values or separating data into ranges of cells; additionally, you can place borders around individual cells.

We might be familiar with the concept of adding colours for cells depending on the values of those cells; but, what about creating borders in Excel based on the values of the cells? Conditional formatting in Excel is discussed here, namely how it can be used to add borders to cells based on the values of those cells.

Border Cells Based on Values with Conditional Formatting in Excel

Suppose we have a table called Marks, and we want to border cells in Column B that contain greater than equal 35 marks each. You can accomplish this in the following manner.

Let’s understand step by step with an example.

Step 1

Let’s assume, we have a student’s marks list. Please refer to the screenshot below for the same.

Step 2

Choose the range that contains the cells that you want to border. In our particular scenario, we will be using the range B2:B10. On the Home menu, select Conditional Formatting click New Rule to create a new rule. Check out the screenshot below for the same.

Step 3

Now you are at the New Formatting Rule dialog box, and you need to click in the Select a Rule Type box to highlight the Use a formula to determine which cells to format option. Enter the following formula into the box labelled Format values where this formula is true. Then select Format button.



Step 4

In the subsequent Format Cells dialog box, navigate to the Border tab, specify a line style and in the Line section, click the Outline button in the Presets section, and click OK button. Please refer to the below screenshot for the same.

Step 5

In the New Formatting Rule dialogue box, click the OK button. As demonstrated in the image below, all cells with marks greater than or equal to 35 now have extra borders.


In this tutorial, we explained how you can border cells based on cell values by using conditional formatting rule in Excel.