HomeGoogle DocsSpreadsheetHow to Wrap Text Using Formula in Google Sheets

How to Wrap Text Using Formula in Google Sheets [One Word Per Line]

Published on

Here I am sharing you an awesome Google Sheets Trick. Do you know you can wrap text using formula in Google Sheets? If not I’m revealing that trick. But before that let me clarify one thing. It’s not a perfect word wrap. It has limitation but you can overcome it a little bit. Because, with this wrap, you can wrap only single word per line. No control over column width. You can use any length sentence for word wrap using my short formula.

Wrap Text Using Formula in Google Sheets

Here I’m using a combination of Google Sheets Text formulas to word wrap in a cell. What are those nested formulas then?

SPLIT, CHAR, and JOIN are those tricky formulas. I’m going directly to the word wrap formula. Head to our Google Sheets Function Guide to learn the above-said functions in details and also with advanced tips.

The Formula to Wrap Text or Sentences in Google Sheets

When your text or sentence is in Cell A2, you can use the below formula in cell B2 to get the wrapped text.

=join(char(10),split(A2," "))

See the screenshot again.

Text Formula to Wrap Text or Sentences in Google Sheets

The Limitation:

The above short formula puts each word in a new line. It has not controlled over the column width. So to overcome this limitation there are limited options. See this modified formula.

word wrap in google sheets using formula

Here there is a long sentence in cell A3 though part of the text is hidden. You can see the wrapped form of this sentence in Cell B3.

What is the difference with this formula compared to the first one? Here I’ve used Comma delimiter in the SPLIT function whereas in the first formula I’ve used the SPACE delimiter. So accordingly the wrapping happened.

When you want to have more control over the Word Wrap using formula in Google Sheets, just manually add Comma to the sentence in Cell A3, as per the above example, and use the second formula. But I think it’s not legible as putting additional commas to your original sentence could spoil it.

In such cases, you should think about the Regexreplace function. Here are some more examples to Wrap Text Using Formula in Google Sheets.

The Regex Formula to Wrap Two Words Per Line

Text in Cell A1: “This is a google sheets tutorial”

Formula:

=trim(regexreplace(A1, "(\w+\s*\w+)", char(10)&"$1"))

Result:

“This is
a google
sheets tutorial”

The Regex Formula to Wrap Three Words Per Line (sometimes random)

Formula:

=trim(regexreplace(A1&" ", "(\w+\s\w+\s\w+)", char(10)&"$1"))

Though this formula is set to wrap the sentence after every third word, it behaves differently.

The comma and full stop, if any, between affect the wrap and give you a natural word wrap feel. So I would like to call it a random wrap formula.

word wrap using formula in Google Doc Sheets

Hope you could understand the above tutorial on wrap text using formula in Google Sheets. I hope it may be useful for some of you.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

XLOOKUP in Excel: Working with Visible Rows in a Table

In Excel, the XLOOKUP function isn't inherently designed to exclusively work with visible rows;...

SUMPRODUCT Differences: Excel vs. Google Sheets

The core purpose of the SUMPRODUCT function remains consistent across both Excel and Google...

More like this

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.