How to Insert Diagonal Lines in Cell in Google Sheets

Those who deal with tables in Excel frequently are no stranger to insert diagonal lines in cell in Google Sheets. Diagonal lines are often inserted to differentiate the title for the top row and first column in a table

However, in Google Sheets, there are no built-in features to split a cell diagonally. Do not fear! This guide will show you creative ways to insert diagonal lines within a cell. 

 

 

Using SPARKLINE Function to Insert Diagonal Line

If you only need to insert a diagonal line in the cell without any data within, the SPARKLINE function is perfect for this!

What the SPARKLINE function does is create miniature charts that are contained within a single cell.

The way we write the SPARKLINE function is: 

= SPARKLINE(data, [options])

Let us help you understand the context of the function:

  • The equal sign =  is how we start any function in Google Sheets.
  • SPARKLINE() is our function. We need to add two attributes, namely the data and [options], to make it work correctly.
  • The data is the data to plot.
  • The [options] are optional settings used to customize the chart.

 

Example:

  1. Simply click on the cell that you want to write down your function at. In this example, it will be A1.

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Begin your function with an equal sign =, then followed by the name of the function, SPARKLINE, then an open parenthesis(.

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Next, we will insert a curly bracket {, followed with ‘1,0, then closed with another curly bracket }. Separate the first attribute from the second by adding a comma ,

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Now, let’s input some options to formulate how the line would turn out. In this example, we would like the diagonal line to be black. So, insert a curly bracket {}, and add color, black within. 

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. After the following steps, your input should look like this:

 

You can also adjust the width and height of the cell, and the diagonal line will adjust itself to fit the size of the cell. Neat right?

What if you want to input some text into the cell as well? Let’s move on to other methods!

 

 

Using Text Rotation to Insert Diagonal Line

Here is a simple way to add text and a diagonal line within a cell. We will be using the Text rotation tool within the Google Sheet.

 

Example: 

  1. First, click on the cell you would like to insert the diagonal line in. For this example, it would be B3.

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. We will then insert the title for the column and row. In this example, it would be Month for the column title and Store for the row title. To stack the words on top of each other, simply press Alt+Enter simultaneously. 

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Don’t forget to create some space in between the two titles by pressing Alt+Enter simultaneously again! 

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Let’s add a line between the two titles. To do that, we will add several dashes “ to create a line. 

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. Lastly, to make it diagonal, we will be using the Text Rotation tool. 

 

  1. Go to your toolbar, select ‘Format, then select Text Rotation. Several options would appear on how you would like to rotate the text. For our case, we will be using Tilt Down.

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

  1. After following all the steps, your input should look like this:

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

The “Text Rotation” tool can also be found in the top toolbar.

 

 

Using the Drawing Tool to Insert a Diagonal Line

Using the Drawing tool, you can create a more professional look compared to the previous method. The Drawing tool is a built-in feature in Google Sheets. It allows you to add customized drawings to your sheets.

 

Example: 

  1. First, click on the cell you would like to insert the diagonal line in. In this example, it would be B3

 

  1. Similar to the previous example, we will add the titles Month and Store with spacing in between. Make sure to play around with the placement of the titles. We had placed the words on the far end of each corner to create some space between them. This would make more sense once we add the diagonal line!

 

  1. Let’s go ahead and select ‘Insert then press on ‘Drawing.

 

  1. Once you clicked on ‘Drawing a box will appear. To draw a line, click on the line icon. We will then proceed to draw a line within the box. The line you draw does not need to be big, because after we press ‘Save and Close, it is still resizable. 

 

  1. After pressing ‘Save and Close, the line would appear on top of your cell. You will need to press on the line to resize it to fit your cell. 

 

  1. Once it is resized, it would look like this:

How to Insert Diagonal Line in Cell in Google Sheets - Sheetaki

 

Compared to the previous-tilt method, this gives a more visually appealing result. 👌

However, do take note that by using the “Drawing” tool, the line would act as an image on top of the cell. Unlike the SPARKLINE function, you will need to resize the line to your desired width and height. 

You may make a copy of the spreadsheet using the link attached below and try it for yourself:

There you have it, three entirely different ways to create diagonal lines in a cell! 

Don’t forget to subscribe to be the first one notified on our latest tutorials!

 

Get emails from us about Google Sheets.

Our goal this year is to create lots of rich, bite-sized tutorials for Google Sheets users like you. If you liked this one, you'll love what we are working on! Readers receive ✨ early access ✨ to new content.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like