When working with data in Excel and creating reports/dashboards, sometimes you would have a need to split a cell diagonally.
This is helpful when you want to show two separate headings within the same cell – one for the row and one for the column (as shown below in cell A1).
And being the super awesome spreadsheet tool that Excel is, there is an inbuilt way to easily insert a diagonal line within a cell in Excel.
In this tutorial, I would show you how quickly split a cell diagonally in Excel.
So let’s get started!
Inserting a Diagonal Line in Excel
Suppose you have a data set as shown below and you want to insert a diagonal line in cell A1.
Below are the steps to do this:
- Select the cell in which you want to insert the line (which is cell A1 in our example)
- Click the Home tab
- In the Font group, click on the dialog box launcher icon (the small, tilted arrow at the bottom right of the group)
- In the Format cells dialog box, click on the ‘Border’ tab
- In the Border section, click on the diagonal line icon at the bottom right of the section (as shown below). This will also show you the live preview of how the cell would look like
- Click Ok
The above steps would insert a diagonal line within the selected cell. In case you have selected multiple cells, this would insert the diagonal line in all the selected cells.
You can also customize the line that is inserted.
For example, you can choose the thickness of the line or the color of the line that should be inserted in the cell. The setting is right there in the format cells dialog box within the border group (as highlighted below).
You first need to make the Style and Color selections (if needed) and then click on the diagonal border icon.
You can also use the same method to insert a diagonal line in merged cells.
Now that we have the diagonal line in the cell, all you have to do is insert the text for the two headers and space it out a little bit to make it look as if it’s separated by the tilted line.
Let’s say I want to insert the header ‘Month’ at the top and ‘Country’ at the bottom within the same cell.
Below are the steps to do this:
- Select the cell that already has the diagonal line
- Double click on the cell, or press the F2 key on your keyboard to get into the edit mode
- Enter the text ‘Month’ (which is the header title for the first row)
- While still being in the edit mode, hold the ALT key and press the Enter key (or Option + Enter key if you’re using Mac). This will insert a line break and take your cursor to the next line within that same cell
- Enter the text ‘Country’ (which is the header title for the first column)
- Adjust the formatting (such as make it bold, align text to the left, increase the row height), and add some space characters before the ‘Month’ header to push it a little to the right
The above steps would insert two headers in the same cell and make it appear that these are being divided by a diagonal line.
How to Remove the Diagonal Line in the Cell
If you want to get rid of the line within the cell, just follow the same steps and you can remove it in the same Format Cells dialog box.
In the Border tab, click on the None option in the Presets and then click on OK.
This will make the diagonal line go away.
So this is how you can easily split the cells diagonally in Excel by inserting a line using the format cells dialog box options.
I hope you found this tutorial useful.
Other Excel tutorials you may also like:
- How to Indent in Excel (3 Easy Ways + Keyboard Shortcut)
- How to Add Bullet Points in Excel
- How to Split Cells in Excel (separate into multiple columns)
- How to Freeze Row/Column Headers
- Working with Gridlines in Excel: How to Add, Remove, Change, and Print Gridlines
- How to Rotate Text in Cells in Excel
- How to Split Screen in Excel (Compare Side-by-Side)
- How to Insert/Draw a Line in Excel (Straight Line, Arrows, Connectors)