In this video tutorial we will look at two methods for capitalising the first character of each word within a cell. To use Flash Fill to capitalise the first letter of each word in a column: To use the PROPER function to capitalise the first letter of each word in a column: The
advantage of using the PROPER function is that it will update if the original text is updated, whereas Flash Fill will not update. This tutorial will teach you how to add text in Google Sheets at the same position of all cells at once: at the beginning, at the end, after the N-th character, before or after particular characters. As it happens, there's no direct standard way to insert text strings and characters to a certain position of a Google Sheets cell, not to mention to all selected cells at once. But here it goes — several workarounds to add text to the desired positions. They include some standard functions and a special Add text add-on. Formulas to add text in Google SheetsThough formulas in spreadsheets require a bit of learning, they can solve lots of different tasks. Inserting text in Google Sheets cells is not an exception. Insert text at the beginning of Google Sheets cellsConcatenation in spreadsheets is usually used to combine two records into one string, e.g. 'Solar' from A1 and 'Opposites' from B1 will become 'Solar Opposites' in C1. But how is it supposed to help when you need to add the new text to Google Sheets cells that already contain some data? Pretty easy: concatenate the 'new' part with the 'old' part. How to add text in Google Sheets cells using an ampersand (&)Ampersand is a special concatenation character that is used to merge values in spreadsheets. When you use it in cells, it looks like this:
or
The result will be literally 'John Doe' or any other combo of whatever lies in A2 and B2. I'm going to take advantage of this to insert new text at the beginning and the end of my cells. Let's suppose I have a list of phone numbers belonging to customers in the US: I'm going to use the ampersand to insert a country code — +1 — at the beginning of those cells. Since records will look like formulas, I will do that in the neighbouring column. Here's what I enter to B2:
Note. I enter space after +1 in the same double-quotes since the formula doesn't separate records by default. I could copy that formula down the column to fill other cells, but I have a better idea. I will wrap the formula in B2 in ArrayFormula and change the A2 reference to the range for the entire column:
Add text at the beginning with the CONCATENATE functionThe CONCATENATE function also exists in spreadsheets so you could merge text strings. But unlike the ampersand, the function makes you list the units to merge as its arguments: CONCATENATE(string1, [string2, ...]) Tip. If you want to learn the function inside out, we have an entire blog post devoted to it. And that's what I'm going to do: use the new text that I want to add as one of those arguments. Look how I use the function to add the same country codes to the beginning of the phone numbers:
Tip. I mention space as an individual argument — the second one in my case. Then you just copy the formula down the column
if Google Sheets doesn't offer to auto-fill it for you and you will have that country code added at the beginning of all cells: Insert text at the end of Google Sheets cellsTo add text in Google Sheets at the end of cells, you can use the same concatenation methods as for inserting text at the beginning of cells — an ampersand (&) and the CONCATENATE function. Use ampersand to add text in Google SheetsLet's see how the ampersand is used to add text or any characters to the end of the cells. This time, you need to place a reference to a cell with the existing record first, then append the new text:
To insert the same to all other cells, ArrayFormula will also help: Tip. Of course, you can add the text at both positions in all cells at the same time:
How the CONCATENATE function adds text to the end of cellsThe CONCATENATE function inserts text to the end of Google Sheets cells just like it does to the beginning. Only this time mention your new text string as the last argument:
How to add text in Google Sheets before/after charactersREGEXREPLACE is a Google Sheets function that replaces a part of the text in a cell with some other text. The name of the function is actually an acronym from 'regular expression replace'. That's right — the function uses regular expressions to look for a certain text in a certain position and replace it with the required string. I'll show you how to use that to your advantage and replace one string with the other while inserting new characters at the same time. Tip. If regular expressions are the last thing you want to spend your time on, I have good news. Below I describe one user-friendly tool that will add text almost in an instant. Feel free to jump to it right away. REGEXREPLACE needs 3 arguments: REGEXREPLACE(text, regular_expression, replacement)
It's the 2nd argument that requires the most attention and a learning curve. Let's see. I have the same list of randomly generated US phone numbers: I'm going to make these numbers look presentable by wrapping the country code into brackets and adding a couple of whitespaces: +1 (202) 5550158. Here's the formula I should use:
Let me break it down into pieces for you:
Phew! Don't worry if it still looks difficult — this is not the easiest thing to understand. Feel free to jump to the last and the easiest solution right away or bear with me for I'm going to insert those dashes in-between numbers. Add text in Google Sheets after the N-th characterI will go ahead and add a dash after 555: +1 (202) 555-0158. If you count the characters, you will see that the dash is going to be inserted at the same position in all the cells — after the 12th character. So for this example, I will show you the mask required to add text after the N-th character in a cell:
And this is it :) Of course, your use case may be different and may require another mask. Feel free to refer to this list of masks and their correct syntax. Or, instead, give the next solution a try — no formulas, no masks. Just a simple add-on with 5 radio buttons to solve the task. Formula-free way to add text in Google SheetsThere's a more elegant, quicker and user-friendly solution available to insert text in Google Sheets to any part of your cells. The add-on is called Add text and is part of the Power Tools collection. Tip. Watch this video to get to know the tool better, ot feel free to read the short introduction right below it. With this add-on, you are 4 steps away from the result:
You can even skip empty cells and add text only to cells with data. Power Tools also includes 30 more add-ons for spreadsheets, so it's definitely worth checking out. I hope that by now you know more about adding text in Google Sheets at different positions of cells. If you have any questions left, I'll be waiting for them in the comments section below :) See you in the next blog post! You may also be interested in: |