Adding a border in Excel is one of the quickest ways to make your data easier to read and more professional. You can outline a single cell, a range of cells, or even just specific sides of a cell. The fastest method is to select the cells, go to the Home tab, and click the Borders button (the square with four lines) in the Font group. From there, choose a preset border style or open the More Borders option for full control. This guide covers all the ways to add, customize, and remove borders in Excel for Microsoft 365 on Windows, with notes for Mac and Excel for the web.
What You’ll Need
- Microsoft Excel (Microsoft 365, Excel 2021, 2019, or 2016) on Windows, Mac, or the web version.
- A worksheet with data you want to format (or a blank sheet to practice).
- Basic familiarity with selecting cells (click and drag, or Ctrl+Click for non-adjacent ranges).
Step-by-Step
- Select the cells you want to border. For a single cell, just click it. For a range, click and drag across the cells. To select non-adjacent cells, hold Ctrl (Windows) or Cmd (Mac) while clicking each cell.
- Go to the Home tab on the ribbon. Look for the Font group, which contains the Borders button (it looks like a square divided into four smaller squares).
- Click the Borders button (the drop-down arrow next to it, not the button itself, to see all options). A menu appears with preset border styles: Bottom Border, Top Border, Left Border, Right Border, No Border, All Borders, Outside Borders, Thick Box Border, and more.
- Choose a preset like All Borders to add a border around every selected cell, or Outside Borders to add a border only around the outer edge of the selection. The border is applied immediately.
- For more control, select More Borders at the bottom of the menu. This opens the Format Cells dialog box on the Border tab.
- In the Format Cells dialog, choose a line style (solid, dashed, thick, etc.) from the Style list, and a color from the Color drop-down.
- Click the border buttons (the small boxes around the preview) to apply the chosen style to specific sides. For example, click the bottom border button to add a line under the cell. You can also click directly on the preview diagram.
- Click OK to apply the custom border. The borders appear on your selected cells.
For Mac: The steps are the same, but the ribbon is slightly different. The Borders button is still under the Home tab in the Font group. The More Borders option opens the same dialog.
For Excel for the web: The Borders button is on the Home tab, but the More Borders option is limited. You can choose from the preset styles, but you cannot customize line color or style beyond the presets. For full control, use the desktop version.
Common Mistakes
- Clicking the Borders button instead of the drop-down arrow – This applies the last-used border style, which might not be what you want. Always click the arrow to see the full menu.
- Selecting the wrong cells – Borders are applied to the exact selection. If you include extra rows or columns, you’ll get borders where you didn’t intend.
- Using All Borders when you only need outside borders – This creates a grid inside the selection, which can look cluttered. Use Outside Borders for a clean outer edge.
- Forgetting that borders don’t print by default – If you print and don’t see borders, check the Page Layout settings (see Troubleshooting).
Tips
- Use the Format Painter to copy borders to other cells. Select the cell with the desired border, click the Format Painter icon (a paintbrush) in the Clipboard group on the Home tab, then click the target cells.
- Create a custom border style by saving a cell style. Right-click a cell with the border, go to Cell Styles (on the Home tab), and choose New Cell Style to reuse it later.
- Keyboard shortcut – Press Ctrl+Shift+& (Windows) or Cmd+Shift+& (Mac) to apply an outline border to the selection. To remove all borders, press Ctrl+Shift+_ (Windows) or Cmd+Shift+_ (Mac).
- Use borders to create visual sections – For example, a thick bottom border under a header row helps separate it from data.
Troubleshooting
Borders don’t appear on screen. Check if the cells are formatted with a fill color that might hide the border. Also, ensure the view is set to Normal (View tab > Workbook Views > Normal). Sometimes, gridlines can make borders hard to see – try zooming in.
Borders don’t print. Go to Page Layout > Page Setup > Sheet tab, and under Print, check the Gridlines box if you want gridlines printed. However, borders are separate from gridlines. If borders don’t print, it’s usually because the border color is set to white or the line style is too light. Also, check the print preview to confirm.
Borders are applied to the wrong cells. Undo with Ctrl+Z (Windows) or Cmd+Z (Mac), then reselect the correct range and reapply.
Can’t find the More Borders option. In Excel for the web, this option is not available. Use the desktop app for full customization. In older versions, the option might be labeled Border in the Format Cells dialog, which you can open with Ctrl+1 (Windows) or Cmd+1 (Mac).
Frequently Asked Questions
How do I remove all borders from a cell? Select the cells, go to the Borders menu, and choose No Border. Alternatively, use the keyboard shortcut Ctrl+Shift+_ (Windows) or Cmd+Shift+_ (Mac).
Can I add a border to only the top and bottom of a cell? Yes. Select the cell, open More Borders, and click only the top and bottom border buttons in the preview. You can also use the preset Top and Bottom Border if available.
How do I change the color of a border? Open More Borders, select a color from the Color drop-down, then click the border buttons you want to apply that color to. Make sure you select the color before applying the border lines.
Why do my borders disappear when I filter data? Filters hide rows, but borders remain on the visible cells. If you want borders to stay with the data, apply the border to the entire range, including hidden rows. When you filter, the borders on hidden rows are not shown, but they reappear when the filter is removed. This is normal.
Can I use a border as a separator without gridlines? Yes. Turn off gridlines by going to View > uncheck Gridlines in the Show group. Then apply borders to create your own separator lines.
Is there a way to apply the same border to multiple non-adjacent ranges? Yes. Select the first range, then hold Ctrl (Windows) or Cmd (Mac) and select additional ranges. Then apply the border as usual – it will apply to all selected ranges.
Related
- Tally Prime Data Entry: A Step-by-Step Guide
- How to Add a Border in Excel Spreadsheet
- What Are My Data Limits? A Complete Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Custom Number Format in Excel for Lakhs: A Clear GuideTo show numbers with Indian lakh-style digit grouping in Excel, select the cells, press Ctrl+1, choose Custom, and…
- Excel Freeze Panes: Freeze More Than Just the Top RowNo—Excel’s Freeze Panes command is not limited to the top row. In Excel for Microsoft 365 on Windows,…
- Budget Spreadsheet Sheets: What Tabs to IncludeA useful budget spreadsheet usually has a monthly budget sheet, a transaction log, and a bills or irregular-expenses…
- Embed Video in PowerPoint: What Embed Code Can Do TodayYou generally cannot paste a website’s raw HTML embed code into a PowerPoint slide and expect it to…
- How to Double Space in Word on Windows 11, Step by StepTo double-space text in Word on Windows 11, select the text, open Home > Line and Paragraph Spacing,…
- How to Highlight a Box in ExcelTo highlight a box in Excel, select the cell or rectangular range, then choose Home > Fill Color…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.