class SpreadsheetApp method .getColumn()

SpreadsheetApp is the Apps Script service.

.getColumn() is the method name you will see after a dot in your code.

What it does

Returns the starting column index of a range.

Why it's used

  • Find which column a cell is in for column-based rules.
  • Apply different logic depending on where a value lives.

Common errors

  • Forgetting parentheses on getColumn. Write SpreadsheetApp.getColumn(), not SpreadsheetApp.getColumn or getColumn by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getColumn().
  • Adding spaces where they do not belong. Write SpreadsheetApp.getColumn(), not SpreadsheetApp .getColumn(), SpreadsheetApp.getColumn (), or SpreadsheetApp . getColumn().
  • Wrong capitalization. Use SpreadsheetApp and getColumn, not spreadsheetapp or getcolumn.

Explore

Related methods

  • .getRow()

    Returns the starting row index of a range.

  • .getNumColumns()

    Returns how many columns are in a range.

  • .getRange()

    Returns a range of cells by A1 notation or row and column numbers.

  • .getLastColumn()

    Returns the column number of the last column that has content.

  • .offset()

    Returns a range shifted by a number of rows and columns.

7 Better Sheets tutorials

Add A Timestamp to Task Lists (without Now Formula)

Add A Timestamp to Task Lists (without Now Formula)

How to add a timestamp to done tasks. Learn how to easily add timestamps...
Add Tasks to Google Tasks From Google Sheets

Add Tasks to Google Tasks From Google Sheets

Create tasks in Google Tasks from Google Sheets using Apps Script
Automated Project Management in Google Sheets

Automated Project Management in Google Sheets

Create automatic notifications when a project is assigned, a project nee...
Automate Google Sheets With Zero Experience

Automate Google Sheets With Zero Experience

By the end of this video you should be knowledgeable about how to automa...
Automate Help Desk Ticket Closing

Automate Help Desk Ticket Closing

Create a simple automated help desk ticketing system. • Create tickets C...
Automatically Check Past Stages

Automatically Check Past Stages

Create an automation that runs whenver we check off a checklist item the...
Basic CRM - Add a Powerful Script To Move Row Based on Status

Basic CRM - Add a Powerful Script To Move Row Based on Status

we're going to be adding a very powerful script to our CRMs or any datab...

Related blog posts

Written guides about SpreadsheetApp.getColumn().

Browse the blog