
- MS Excel Basics
- Excel - Home
- Excel - Getting Started
- Excel - Explore Window
- Excel - Backstage
- Excel - Entering Values
- Excel - Move Around
- Excel - Save Workbook
- Excel - Create Worksheet
- Excel - Copy Worksheet
- Excel - Hiding Worksheet
- Excel - Delete Worksheet
- Excel - Close Workbook
- Excel - Open Workbook
- Excel - Context Help
- Editing Worksheet
- Excel - Insert Data
- Excel - Select Data
- Excel - Delete Data
- Excel - Move Data
- Excel - Rows & Columns
- Excel - Copy & Paste
- Excel - Find & Replace
- Excel - Spell Check
- Excel - Zoom In-Out
- Excel - Special Symbols
- Excel - Insert Comments
- Excel - Add Text Box
- Excel - Undo Changes
- Formatting Cells
- Excel - Setting Cell Type
- Excel - Setting Fonts
- Excel - Text Decoration
- Excel - Rotate Cells
- Excel - Setting Colors
- Excel - Text Alignments
- Excel - Merge & Wrap
- Excel - Borders and Shades
- Excel - Apply Formatting
- Formatting Worksheets
- Excel - Sheet Options
- Excel - Adjust Margins
- Excel - Page Orientation
- Excel - Header and Footer
- Excel - Insert Page Breaks
- Excel - Set Background
- Excel - Freeze Panes
- Excel - Conditional Format
- Working with Formula
- Excel - Creating Formulas
- Excel - Copying Formulas
- Excel - Formula Reference
- Excel - Using Functions
- Excel - Builtin Functions
- Advanced Operations
- Excel - Data Filtering
- Excel - Data Sorting
- Excel - Using Ranges
- Excel - Data Validation
- Excel - Using Styles
- Excel - Using Themes
- Excel - Using Templates
- Excel - Using Macros
- Excel - Adding Graphics
- Excel - Cross Referencing
- Excel - Printing Worksheets
- Excel - Email Workbooks
- Excel- Translate Worksheet
- Excel - Workbook Security
- Excel - Data Tables
- Excel - Pivot Tables
- Excel - Simple Charts
- Excel - Pivot Charts
- Excel - Keyboard Shortcuts
- MS Excel Resources
- Excel - Quick Guide
- Excel - Useful Resources
- Excel - Discussion
How to add a border to cells by using IF statement in Excel
To add a border around the cells is easy and handy for most Excel users, however how about including a border to cells with the aid of the usage of the IF function. In this article, you will learn how to add a border to cells via an IF statement in Excel.
Add a Border to Cell Using the IF Statement
To add a border to cells through the IF statement, you can observe the effective Conditional formatting feature, and then add the IF statement to its rule
Step 1
For example, consider you have a range of cells and you want to add a border to the cell if it is greater than 200.
Step 2
Select all the names and sales in the Excel workbook, and click Home > Conditional formatting > New Rule as shown below.
Step 3
Then in the New Formatting Rule dialog, select Use a formula to determine which cells to format and type the formula =$B2>200 into the Format values where this formula is true textbox as shown in the below screenshot.
In the formula, B2 is the first cell of the range that you want to add a border by IF function.
Step 4
Click Format to open the Format Cells dialog box, click the Border tab, and then specify the border style you desire.
Step 5
Click OK to close the dialog boxes. You will notice that those cells with a value greater than 200 will have a border around them, as shown in the following screenshot.
Since I have selected both the Name and Sales it has bordered names and sales if you want only sales to be boarded then you can select only sales.
Likewise, if you want to border any name or specific you can enter the formula =$A4="Klaus" and repeat the above steps. The border will be placed around the name Klaus.
- Related Articles
- How to Add Units to Cells in Excel?
- How to border cells based on cell values in Excel?
- How to add borders automatically to cells in Excel?
- How to add all borders to cells with shortcuts in Excel
- How to Add Prefix or Suffix to a Range of Cells in Excel
- Add a custom border to certain cells in a Matplotlib / Seaborn plot
- How to Add Words/Texts from Different Cells Together in Excel?
- How To Add Text Cells Together Into One Cell In Excel?
- How to divide a range of cells by a number in Excel?
- How to Add Percentage Symbol for Multiple Numbers in Cells in Excel?
- How to Add Text in the Middle of Selected Cells in Excel?
- How to compare if multiple cells are equal in Excel?
- How to check if / find cells contains formulas in Excel?
- How to add border line below when value changes in an Excel column?
- How to Add Text at the Beginning or End of All Cells in Excel?
