How to Underline in Google Sheets

puneet-gogia-excel-champs

- Written by Puneet

An Underline is among the least used formatting in Google Sheets and Microsoft Excel. But, if you are one of those users who format your workbooks a lot, applying an underline can be super helpful.

And the best way is to apply the underline in Google Sheets is to use the keyboard shortcut (Ctrl + U). But apart from this there’s an option in the Format menu.

So, in this tutorial, we will check out all the options available. Let’s get started…

Keyboard Shortcut to Apply Underline in Google Sheets

Applying underlining to cells in Google Sheets can be quickly done with a keyboard shortcut.

  • For Windows and Linux Users: Press Ctrl + U
  • For macOS Users: Press Cmd + U

You can select a single cell, a range of cells, or multiple ranges (using the Ctrl key or Cmd key on macOS). With the cells selected, use the keyboard shortcut (Ctrl + U or Cmd + U) to toggle underlining on or off. This will underline all text within the selected cells.

As I have mentioned above, to remove underline, reselect the text and press the same shortcut again. This toggles the formatting off.

Apply Underline from the Format Options

Here’s are simple steps on how to do it:

  1. Select the cell or range of cells where you want to apply the Underline.
  2. After that, click Format in the menu at the top of Google Sheets.
  3. Then, go to the Text option to expand additional options.
  4. In the end, click on Underline from the expanded menu options.

And the same option can be used to remove the underline from a cell or a range.

Apply Underline to the partial Value in Google Sheets

Applying underline formatting to a partial value within a cell in Google Sheets is a little tricky (not much) than applying it to the entire cell.

Click on the cell containing the text you want to partially underline. Double-click inside the cell or press F2 on your keyboard to enter text editing mode.

Now, use the mouse to select the partial text or number to which you want to apply the underline.

In the end, use the keyboard shortcut Ctrl + U, or go to the Format > Text > Underline to apply the Underline to the part of the cell value you have selected.

Note– If you’re trying to underline parts of multiple cells, you’ll need to repeat this for each cell individually, as there’s no way to automate partial text formatting across multiple cells at once.

Double Underline in Google Sheets

Well, this option isn’t available directly in the Google Sheets.

  1. Select the cell (s): Click to select the cell where you want the double underline.
  2. Open the Borders Toolbar: Click on the border icon (it looks like a grid) in the toolbar.
  3. Apply Double Bottom Border: Click on the “Bottom double border” option from the “Border Style” drop-down, which typically shows two stacked lines.

Double underline is especially useful for financial reports or any data that requires distinct emphasis on specific totals.

Add Underline in iOS or Android (Mobile App)

And if you are using the

  • Touch the cell you want to apply the underline. Then, tap the A with a horizontal line under it (Format button), usually found at the top or bottom toolbar.
  • Tap the underline button (U) that appears in the formatting menu. This will apply an underline to the selected text or all text within the cell if no specific text is highlighted.

Once you click on the button it applies underline to the selected cell.

Remove Underline in Google Sheets

The best way is to remove the underline is to use the same way which you have used to apply it. For this, you need to select the cell or the range and the use the keyboard shortcut or go to the Format > Text > Underline.

Remove Underline from the Entire Sheet using a Script

In the worksheet, from which you want to remove underline entirely. You can use the below script:

function removeingUnderlines() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();  // Get the active sheet
  var range = sheet.getDataRange();  // Get the range of cells that have data
  var rows = range.getNumRows();
  var cols = range.getNumColumns();
  
  // Iterate over each cell in the range
  for (var i = 1; i <= rows; i++) {
    for (var j = 1; j <= cols; j++) {
      var cell = range.getCell(i, j);
      var style = cell.getTextStyle();
      if (style.isUnderline()) {
        cell.setTextStyle(style.copy().setUnderline(false).build());
      }
    }
  }
}

To run this code, you need to go to the Extension > App Script > Paste the code in the script editor. Click the floppy disk icon to save, then click the play icon to run the script.

Last Updated: April 19, 2024