class SpreadsheetApp method .setValue()

SpreadsheetApp is the Apps Script service.

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

What it does

Writes a value into a single cell.

Why it's used

  • Write a timestamp, status, or result into one cell.
  • Stamp last run or an error message in a control cell.

Common errors

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

Explore

Related methods

Better Sheets tutorials

2 New Ways To Add Emoji Reactions

2 New Ways To Add Emoji Reactions

 Revolutionize the way you react with emojis! Discover two new methods t...
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 Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Create a click Edit: Google changed how the redirect is handled. It no l...
Add NPS to Your Google Site

Add NPS to Your Google Site

Create buttons on your Google Site to get an NPS, or Net Promoter Score ...
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
Automate Emails

Automate Emails

Set up automated email notifications based on Google Sheets data. Super ...
Automate Form Response to Confirmation Email

Automate Form Response to Confirmation Email

Create an email automatically when someone fills out a google form. incl...
Automate Help Desk Ticket Closing

Automate Help Desk Ticket Closing

Create a simple automated help desk ticketing system. • Create tickets C...
Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically copy a spreadsheet tab to a whole new spreadsheet file, ge...
Automatic Calculations

Automatic Calculations

Create custom scripts to make your spreadsheets more like tools.
Better Sheets Videos Checklist

Better Sheets Videos Checklist

How to create a video checklist. Create a sheet with check boxes that yo...
Bjarne Asks: Can I show the Last Time of the Last Edit in a sheet?

Bjarne Asks: Can I show the Last Time of the Last Edit in a sheet?

ow do I show the date and time for the last time something was changed i...
Breaking Through Errors In Apps Script

Breaking Through Errors In Apps Script

See where to find errors in your apps script and how to fix them. You wi...
Build a Book Recommender with AI in Google Sheets

Build a Book Recommender with AI in Google Sheets

Create an Email form that sends a few books to AI and gets back a book r...
Build a Case Converter From Scratch

Build a Case Converter From Scratch

Create a little web app, or a tool inside of Google Sheets that can take...
Build a License Key Generator and API in 20 Minutes

Build a License Key Generator and API in 20 Minutes

How to leverage Apps Script to create an API in less than 20 minutes. Cr...
Build Your Own AI Writer in Google Sheets

Build Your Own AI Writer in Google Sheets

Create your own AI writer with these google sheets tips and tricks and c...
Built a Cookie Clicker Clone in Google Sheets

Built a Cookie Clicker Clone in Google Sheets

I built a clone of Cookie Clicker, live on YouTube. Watch the full 1 hou...
Capture Emails from Website Form to a Google Sheet (Without Zapier)

Capture Emails from Website Form to a Google Sheet (Without Zapier)

Embed a little HTML into your site to capture Emails straight to a Googl...
Celebrate Your Completed Checklists

Celebrate Your Completed Checklists

Learn how to use apps script to add emoji animations when you complete a...
ChatGPT Clone in Google Sheets Part 1

ChatGPT Clone in Google Sheets Part 1

In this tutorial, learn how to create a ChatGPT-like interface using Goo...
ChatGPT Clone in Google Sheets Part 2

ChatGPT Clone in Google Sheets Part 2

We fix the problem of OpenAI's API not remembering our last questions. A...
Convert Google Sheets into a REST API

Convert Google Sheets into a REST API

How to use Google Sheets as a database by turning it into a REST API wit...
Copy That, From One Sheet to Another - Learn to Code in Google Sheets Part 4

Copy That, From One Sheet to Another - Learn to Code in Google Sheets Part 4

Learn to code in sheets. Automate Your Daily Sales Report with Google Sh...
Create an Automated Task List

Create an Automated Task List

I've created simple automations to make an awesome automatic task list. ...
Create a new Spreadsheet from just a Name in a Sheet.

Create a new Spreadsheet from just a Name in a Sheet.

Create the Apps Script to create a new sheet from some data inside your ...
Create a PR Agency From Scratch

Create a PR Agency From Scratch

Go from nothing to a working PR agency. Capture sites, and Send email vi...
Create a Radio Button From Checkboxes Using Google Apps Script

Create a Radio Button From Checkboxes Using Google Apps Script

Let's code a Radio button that turns off all checkboxes except the one c...
Create a Stop Watch in a Google Sheet

Create a Stop Watch in a Google Sheet

We'll create a stop watch from scratch. Including Apps Script. What it w...
Create a Timer with Apps Script

Create a Timer with Apps Script

Create a start time and end time and duration of that, with a little bit...
Create a Vote Button from Google Sites to Google Sheets

Create a Vote Button from Google Sites to Google Sheets

Connect your published Google Site to Google Sheets with Apps Script and...
Create a Waterfall of AI Prompts and Responses

Create a Waterfall of AI Prompts and Responses

This is an attempt to create a waterfall effect in sheets. Where an AI r...
Create New Worksheet When Google Form Submitted

Create New Worksheet When Google Form Submitted

Automate copying a template for new form submissions with user data inse...
Creating A Dark Mode Theme | Announcing Dark Habits

Creating A Dark Mode Theme | Announcing Dark Habits

Build a habit tracker in dark mode. Learn how to use emojis and checkbox...
Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curated sites, articles, and more web resources super easily into a Goog...
Daily Writer's Word Count Tracker

Daily Writer's Word Count Tracker

Walk through creating an awesome automatic word count tracker that's eas...
Deep Inside Dark Habits Google Script

Deep Inside Dark Habits Google Script

Go inside this apps script and sheet. See how it's designed and created.
Different Kinds of Automation

Different Kinds of Automation

A brief description of types of automation. I go way more in depth in “M...
Embed Email Form and Name Form into Website to Google Sheets

Embed Email Form and Name Form into Website to Google Sheets

Add names to the Email2Sheet apps script and code.
Enter Google Drive File Name Get URL

Enter Google Drive File Name Get URL

Create a simple automation with an installable trigger that allows you t...
Every Locale Listed in Google Sheets and a Tool to Save Your Sanity

Every Locale Listed in Google Sheets and a Tool to Save Your Sanity

How to change your locale and figure out what changing locales means for...
Expense Tracker Template with Data Entry Form Inside Sheets

Expense Tracker Template with Data Entry Form Inside Sheets

Create a data entry form for an expense tracker. Simple dashboard too wi...
Fast FAQS

Fast FAQS

New Tool for you: Fast FAQs. Create a quick 10 question FAQ for any new ...
Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.

Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.

There was a stories craze. Every app/platform/business was adding 24 hou...
How do I reference a different spreadsheet in Apps Script?

How do I reference a different spreadsheet in Apps Script?

I'll show you how to get text from one spreadsheet file to another with ...
How to Copy To New Tab When Checked

How to Copy To New Tab When Checked

Copy text from one tab to another based on a checkbox being checked.
How to Create AI Images From Google Sheets

How to Create AI Images From Google Sheets

Use the Open AI API and Dall-e-3 to create image in Sheets
How to Merge Cells in Google Sheets

How to Merge Cells in Google Sheets

A master class on merging cells. How to merge two cells. How to merge mu...
How to Power Testimonials with Google Forms and Sheets

How to Power Testimonials with Google Forms and Sheets

I show you how I use a Google Form and a Google Sheet to power the testi...
How to Turn Background Color to Text

How to Turn Background Color to Text

This tutorial showcases a practical solution to convert visual cues into...
I Created an Automatic Emailer

I Created an Automatic Emailer

While creating SheetOps, a new product, I came up with this idea of an a...
Introducing SheetFools

Introducing SheetFools

Free google sheets automations pranks you can use right now. Launching p...
Iterate Numbers with a Simple Apps Script

Iterate Numbers with a Simple Apps Script

You're joining a company and they have some Google Sheets already create...
Learn to Code in Google Sheets, For Programmers

Learn to Code in Google Sheets, For Programmers

Google Sheets uses a scripting language called Google Apps Script, which...
LinkTree in a Google Sheet

LinkTree in a Google Sheet

This tool will allows you to share multiple links on your social media.
Make AI-generated Poems Based on Name

Make AI-generated Poems Based on Name

Create simple poems based on someone's name with AI. AI Apps Script Code...
Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5

Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5

Now that we have a script that we wanna run every day, how do we run thi...
Onboarding Scheduler

Onboarding Scheduler

I will guide you through the process of creating an onboarding scheduler...
One Million Checkboxes

One Million Checkboxes

Check out this fun onEdit() counting you can do with checkboxes in a fun...
Password Protecting Data In a Google Sheet

Password Protecting Data In a Google Sheet

A funky way to password protect some data in a sheet, 3 ways to do it: w...
Password Protecting Data In a Google Sheet Part 2 The Basics

Password Protecting Data In a Google Sheet Part 2 The Basics

Covering some of the basics I skipped over in the part 1 video.
Proof of Life

Proof of Life

Create a script that sends an email to ask for proof of life every month...
Saving OpenAI API Calls inside of Google Sheets

Saving OpenAI API Calls inside of Google Sheets

Copy text output and input into a google sheet from your OpenAI API call...
Shaman: AI Blog Writer

Shaman: AI Blog Writer

I will introduce you to the power of AI writing in Google Sheets using a...
Sheet Stories / Video Notes + Clear 24 Hour Old Videos

Sheet Stories / Video Notes + Clear 24 Hour Old Videos

Revolutionary Method to Manage Your Video Stories! Learn how to delete o...
Simple Inventory Management Automations

Simple Inventory Management Automations

Create a few simple automations like email notifications and low stock a...
Spreadsheet Automation for Beginners

Spreadsheet Automation for Beginners

I start off this video with the idea to show beginners how to automate e...
SubSpyHub Subreddit Scanner

SubSpyHub Subreddit Scanner

I built a subreddit search tool to keep track of subreddits with keyword...
Sync Many Tabs without ImportRange()

Sync Many Tabs without ImportRange()

Sync more than two tabs with Apps Script
Sync Tabs in Different Sections

Sync Tabs in Different Sections

How to sync different sections on different tabs. In this case we're tak...
Sync Two Tabs Without ImportRange()

Sync Two Tabs Without ImportRange()

Get this epic script that automatically edits two tabs and keeps them in...
Timestamp When Done (With Code)

Timestamp When Done (With Code)

Automatically create a timestamp when a certain cell is marked as Done. ...
Track Every Edit (Almost)

Track Every Edit (Almost)

Create a Log sheet in Google Sheets
Tweet From a Sheet

Tweet From a Sheet

See how to tweet from a sheet and get the code below.
Twitter App Clone in a Google Sheet

Twitter App Clone in a Google Sheet

I built a twitter clone in Google Sheets
Ultimate Prompt Writer and Prompt Rater

Ultimate Prompt Writer and Prompt Rater

Create a chat interface inside of Google Sheets using GPT-4. Insert rows...
Visicalc 2023 Design Walkthrough

Visicalc 2023 Design Walkthrough

Design walkthrough of VisiCalc 2023. Watch this if you'd like to see the...
Visicalc 2023 Quick Walkthrough

Visicalc 2023 Quick Walkthrough

This is a fun template I created for April 1st. Take a quick walk throug...

Related blog posts

Written guides about SpreadsheetApp.setValue().

Browse the blog