In this article:

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

December 5, 2024

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.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->