Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to add border to cells by using If statement in Excel?

To add border around cells may be easy for most of Excel users, but how about adding border to cells by using IF function? In this article, I introduce the way to add border to cells by IF statement in Excel.
doc add border by conditonal formatting 1

Add border to cells by IF function


arrow blue right bubble Add border to cells by IF function


To add border to cells by IF statement, you can apply the powerful Conditional Formatting feature, and then add the IF function to its rule.

For example, here I have a range of cells, I want to add border to the cell if it is greater than 450.

1. Select the range you want to use, and click Home > Conditional Formatting > New Rule. See screenshot:
doc add border by conditonal formatting 2

2. Then in the New Formatting Rule dialog, choose Use a formula to determine which cells to format, and type this formula =$B2>450 into the Format values where this formula is true textbox. See screenshot:
doc add border by conditonal formatting 3

In the formula B2 is the first cell of the range you want to add border by If function.

3. Click Format to open Format Cells dialog, click Border tab, and then specify the border style as you need. See screenshot:
doc add border by conditonal formatting 4

4. Click OK > OK to close dialogs. Now if the cell is greater than 450, the cell will be added border around.
doc add border by conditonal formatting 5

Note: If you want to border cells if they are equal to a specific text, such as Apple, you can type this formula =$E2="Apple" to the Format values where this formula is true textbox.
doc add border by conditonal formatting 6

Tip.If you just want to border cells with a specific conditoon, you can try to apply Kutools for Excel's Select Specific Cells utility to select the cells by criteria, and then add border by Format Cells function as shown in the following screenshot. It’s full function without limitation in 60 days, please download and have a free trial now.
doc add border by conditonal formatting 8



Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Jeremy · 2 months ago
    Fantastic explanation on conditional formatting using a formula! You make me look good!