How to quickly insert diagonal line in a cell?
When working with tables or organizing data layouts in Excel, there might be situations—especially when creating custom headers or summary tables—where you need to insert a diagonal line inside a single cell. This graphical style is commonly used to display two different categories in the same cell, such as showing both row and column headers in a table or splitting up a cell for special Notations. This tutorial explains practical methods to add diagonal lines in Excel, discusses their applications, and provides tips to adjust the text layout for clear presentation.
Insert one diagonal line with Border function
Insert two or more diagonal lines with drawing lines
Insert one diagonal line with Border function
Excel provides an intuitive way to insert a diagonal line in a cell using its built-in border function. This method is especially suitable when a single dividing line is needed—such as displaying “Name” and “Score” within the same table header cell.
1. Select the cell where you would like to add the diagonal line. Be sure to click inside the cell, not just the outline, to ensure you’re modifying the correct cell.
2. Right-click the selected cell and choose Format Cells from the menu. This opens the Format Cells dialog box. Click on the Border tab located at the top of the dialog. In the border options, you’ll see a diagonal line buttons—a line from top-left to bottom-right. Click it.
3. Click OK. The diagonal line will instantly appear in your selected cell. If you need to adjust or remove the diagonal later, simply return to the same dialog box and update the border settings as needed.
4. To enter text on either side of the diagonal line, first type the text for one category (e.g., “Name”), then press Alt + Enter to move to a new line within the same cell. Next, type the second category (e.g., “Score”). Use the Space bar to manually adjust and align text to the desired side of the diagonal. Adjust spacing as needed for proper visual separation—fine-tuning may be required depending on the font size, cell size, and amount of text.
If you encounter issues such as text overlapping the line, try resizing the cell, changing the text size, or increasing the number of spaces. Remember that alignment in diagonal header cells often requires visual fine-tuning rather than precise settings. This method is simple and effective for most standard layouts, although it does have limited flexibility if you need more than one diagonal line per cell.

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Insert two or more diagonal lines with drawing lines
The border function in Excel only enables you to insert one diagonal line per cell. If your work requires multiple crossing diagonal lines—or perhaps a custom grid within a single cell for intricate headers or to visually separate multiple data fields—you can use Excel’s Shapes tool to manually draw lines as needed. This approach is flexible and gives you maximum control over the appearance:
1. Select the cell you wish to modify. It may help to temporarily merge several cells if you want a bigger drawing area, but keep in mind that merged cells can affect formulas and sorting operations.
2. Go to the Insert tab on the Excel ribbon, and click Shapes. From the drop-down menu, select a Line shape. You can also choose arrow lines if you prefer a different style.
3. Draw the first diagonal line inside your target cell by clicking and dragging. To add additional diagonals, repeat this process—draw each new line as needed for your layout. See screenshot:
Tip: If you need to further customize the appearance, you can change line color, thickness, or style: right-click the drawn line, select Format Shape, and use the options provided.
4. Enter text into the cell as described previously: type your first entry, use Alt + Enter for a new line, and use the Space bar for manual alignment. You may need to adjust the cell’s size to prevent the text from covering the lines, or move the lines slightly to create more space for text clarity. See screenshot:
Keep in mind that adding drawing shapes to cells can make future editing a little more complex: lines are objects floating over the worksheet, not intrinsic parts of the cell. If you resize rows or columns or move cells, the drawn lines may not automatically adjust their positions. To minimize layout issues, always check your worksheet after making adjustments and reposition lines if necessary.
This method is ideal for creating visually distinctive custom headers or multiple divisions within a single cell, but is best used in worksheets with relatively static layouts.
quickly Insert diagonal line in tables in Word |
The Diagonal Table Header utility of Kutools for Word provides several diagonal table header style for you to quickly insert to a table in Word. Click for45 days free trial! |
![]() |
Kutools for Word: with dozens of handy Word add-ins, free to try with no limitation in 60 days. |
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, 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!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in