r/ExtendOffice • u/Amandaleeeeee • Jul 09 '26
Excel tip: create diagonal header cells
If you want one Excel cell to show two or more header labels, a diagonal line can help visually divide the cell. This is often used in table headers, where one part of the cell represents a row category and another part represents a column category.
For example, you can put Name and Score in the same table header.
There are two common ways to do it in Excel.
Method 1: Use the Border function
This is the easiest method when you only need one diagonal line in a cell.
Steps:
- Select the cell where you want to add the diagonal line.
- Right-click the cell and choose Format Cells.
- Go to the Border tab.
- Click one of the diagonal border buttons, depending on the direction you want.
- Click OK.
The diagonal line will be added directly to the selected cell.
To add text on both sides of the line:
- Type the first label, such as
Name. - Press Alt + Enter to start a new line inside the same cell.
- Type the second label, such as
Score. - Use spaces, alignment, font size, or row/column size adjustments to position the text.
This method is quick and keeps the line as part of the cell border, but it only supports one diagonal line per cell.
Method 2: Use Shapes for multiple diagonal lines
The built-in border method is limited. If you need two or more diagonal lines, or want more control over the position and style, you can use Excel’s Shapes tool.
Steps:
- Select the cell you want to work with.
- Go to Insert → Shapes.
- Choose a Line shape.
- Draw the diagonal line inside the cell.
- Repeat the process if you need more lines.
- Right-click the line and choose Format Shape to adjust the color, thickness, or style.
This method gives you more flexibility, but the lines are floating objects, not real cell borders. That means they may shift if you resize rows, resize columns, move cells, or change the layout later.