In this article:

How to Do String Interpolation in Google Sheets (2024 Guide)

How to Do String Interpolation in Google Sheets

You can perform basic string interpolation in Google Sheets using a combination of functions such as CONCATENATE, & operator, and TEXTJOIN. These functions allow you to combine text strings, variables, and expressions to create a new string that includes variable values.

& Operator

The & operator is a straightforward way to concatenate (or combine) text strings and values. For example, if you have a person's first and last name in separate cells and you want to combine them in a full name format, you could use the & operator like this:

=A1 & " " & B1

For example, if A1 contains "John" and B1 contains "Doe", the result would be "John Doe".

google sheets string interpolation

CONCATENATE Function

The CONCATENATE function is another way to join together text items. The syntax is:

=CONCATENATE(text1, [text2, ...])

For example: 

=CONCATENATE(A1, " ", B1)

This should produce the same result as the example above.

string interpolation in google sheets

TEXTJOIN Function 

The TEXTJOIN function provides more flexibility and is particularly useful when you want to include a delimiter that should only appear between text items that are not empty. The syntax is:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2, ...])

For example, if you want to join several strings but only include commas between them if they are not empty, you could use:

=TEXTJOIN(", ", TRUE, A1, B1, C1)

This formula would join the text in A1, B1, and C1, separating them with a comma and a space, but only if the cells are not empty.

Below is an example:

string interpolation google sheets

While Google Sheets does not natively support string interpolation, the combination of basic concatenation functions offers a way to dynamically construct strings based on the contents of other cells in Google Sheets.

We hope that this article has helped you and given you a better understanding of how to do string interpolation in Google Sheets. If you enjoyed this article, you might also like our articles on how to use vertical align in Google Sheets and how to compare two columns in Google Sheets.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started