Содержание
- Include text in formulas
- How to Add Text to the Beginning or End of all Cells in Excel
- Method 1: Using the ampersand Operator
- Using the ampersand Operator to Add Text to the Beginning of all Cells
- Using the ampersand Operator to Add Text to the End of all Cells
- Method 2: Using the CONCATENATE Function
- Using CONCATENATE to Add Text to the Beginning of all Cells
- Using CONCATENATE to Add Text to the End of all Cells
- Method 3: Using the Flash Fill Feature
- Using Flash Fill to Add Text to the Beginning of all Cells
- Using Flash Fill to Add Text to the End of all Cells in a Column
- Method 4: Using VBA Code
- Using VBA to Add Text to the Beginning of all Cells in a Column
- Using VBA to Add Text to the End of all Cells in a Column
Include text in formulas
We often hear that you want to make data easier to understand by including text in your formulas, such as «2,347 units sold.» To include text in your functions and formulas, surround the text with double quotes («»). The quotes tell Excel it’s dealing with text, and by text, we mean any character, including numbers, spaces, and punctuation. Here’s an example:
=A2&» sold «&B2&» units.»
For this example, pretend the cells in column A contain names, and the cells in column B contain sales numbers. The result would be something like: Buchanan sold 234 units.
The formula uses ampersands ( &) to combine the values in columns A and B with the text. Also, notice how the quotes don’t surround cell B2. They enclose the text that comes before and after the cell.
Here’s another example of a common task, adding the date to worksheet. It uses the TEXT and TODAY functions to create a phrase such as «Today is Friday, January 20.»
=»Today is » & TEXT(TODAY(),»dddd, mmmm dd.»)
Let’s see how this one works from the inside out. The TODAY function calculates today’s date, but it displays a number, such as 40679. The TEXT function then converts the number to a readable date by first changing the number to text, and then using «dddd, mmmm dd» to control how the date appears—«Friday, January 20.»
Make sure you surround «ddd, mmmm dd» date format with double quotes, and notice how the format uses commas and spaces. Normally, formulas use commas to separate the arguments—the pieces of data—they need to run. But when you treat commas as text, you can use them whenever you need to.
Finally, the formula uses the & to combine the formatted date with the words «Today is «. And yes, put a space after the «is.»
Источник
How to Add Text to the Beginning or End of all Cells in Excel
There may be instances where you need to add the same text to all cells in a column. You might need to add a particular title before names in a list, or a particular symbol at the end of the text in every cell.
The good thing is you don’t need to do this manually.
Excel provides some really simple ways in which you can add text to the beginning and/ or end of the text in a range of cells.
In this tutorial we will see 4 ways to do this:
- Using the ampersand operator (&)
- Using the CONCATENATE function
- Using the Flash Fill feature
- Using VBA
So let’s get started!
Table of Contents
Method 1: Using the ampersand Operator
An ampersand (&) can be used to easily combine text strings in Excel. Let’s see how you use it to add text at the beginning or end or both in Excel.
Using the ampersand Operator to Add Text to the Beginning of all Cells
The ampersand (&) is an operator that is mainly used to join several text strings into one.
Here’s how you can use it to add text to the beginning of all cells in a range. Let us assume you have the following list of names and want to add the title “Prof.” before every name:
Below are the steps to add a text before a text string in Excel:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Type equal sign (=), followed by the text “Prof. “, followed by an ampersand (&).
- Select the cell containing the first name (A2).
- Press the Return Key.
- You will notice that the title “Prof.” is added before the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell B2). Alternatively, you can drag down the fill handle to achieve the same effect.
That’s it, all your cells in column B should now contain the title “Prof.” preceding each name.
Using the ampersand Operator to Add Text to the End of all Cells
Now let us see how to add some text to the end of every name in the dataset. Let us say you want to add the text “(MD)” at the end of every name. In that case, here are the steps you need to follow:
- Click on the first cell of the column where you want the converted names to appear (C2 in our case).
- Type equal sign (=)
- Select the cell containing the first name (B2 in our case).
- Next, insert an ampersand (&), followed by the text “ (MD)”.
- Press the Return Key.
- You will notice that the text “(MD).” added after the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell C2). Alternatively, you can drag down the fill handle to achieve the same effect.
All your cells in column C should now contain the text “(MD”) at the end of each name.
Method 2: Using the CONCATENATE Function
CONCATENATE is an Excel function that you can use to add text at the beginning and end of the text string.
Let’s see how to use CONCATENATE to do this.
Using CONCATENATE to Add Text to the Beginning of all Cells
The CONCATENATE() function provides the same functionality as the ampersand (&) operator. The only difference is in the way both are used.
The general syntax for the CONCATENATE function is:
Where text1, text2, etc. are substrings that you want to combine together.
Let’s apply the CONCATENATE function to the same dataset as above:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Type equal sign (=).
- Enter the function CONCATENATE, followed by an opening bracket (.
- Type the title “Prof. ” in double-quotes, followed by a comma (,).
- Select the cell containing the first name (A2)
- Place a closing bracket. In our example, your formula should now be: =CONCATENATE(“Prof. “,A2).
- Press the Return Key.
- You will notice that the title “Prof.” is added before the first name on the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell B2). Alternatively, you can drag down the fill handle to achieve the same effect.
That’s it, all your cells in column B should now contain the title “Prof.” preceding each name.
Using CONCATENATE to Add Text to the End of all Cells
Now let us see how to add some text to the end of every name in the dataset. Let us say you want to add the text “(MD)” at the end of every name. In that case, here are the steps you need to follow:
- Click on the first cell of the column where you want the converted names to appear (C2 in our example).
- Type equal sign (=).
- Enter the function CONCATENATE, followed by an opening bracket (.
- Select the cell containing the first name (B2 in our example).
- Next, insert a comma, followed by the text “ (MD)”.
- Place a closing bracket. In our example, your formula should now be: =CONCATENATE(B2,” (MD)”).
- Press the Return Key.
- You will notice that the text “(MD).” added after the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell C2).
All your cells in column C should now contain the text “(MD”) at the end of each name.
Notice that since you’re using a formula, your column C depends on columns A and B. So if you make any changes to the original values in column A, they get reflected in column C.
If you decide to only retain the converted names and delete columns A and B, you will get an error, as shown below:
To make sure that this does not happen, it’s best to first convert the formula results to permanent values copying them and pasting them as values in the same column (Right-click and select Paste Options->Values from the Popup menu).
Now you can go ahead and delete columns A and B if you need to.
Method 3: Using the Flash Fill Feature
Flash fill is a relatively new feature that looks at the pattern of what you are trying to achieve and then does it for all the cells in a column.
You can also use Flash fill to so text manipulation as we will see in the following examples.
Using Flash Fill to Add Text to the Beginning of all Cells
The Excel flash fill feature is like a magical button. It is available if you’re on any Excel version from 2013 onwards.
The feature takes advantage of Excel’s pattern recognition capabilities. It basically recognizes a pattern in your data and automatically fills in the other cells of the column with the same pattern for you.
Here’s how you can use Flash Fill to add text to the beginning of all cells in a column:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Manually type in the text Prof. , followed by the first name of your list.
- Press the Return Key.
- Click on cell B2 again.
- Under the Data tab, click on the Flash Fill button (in the ‘Data Tools’ group). Alternatively, you can just press CTRL+E on your keyboard (Command+E if you’re on a Mac).
This will copy the same pattern to the rest of the cells in the column… in a flash!
Using Flash Fill to Add Text to the End of all Cells in a Column
If you want to add the text “ (MD)” to the end of the names, follow the same steps:
- Click on the first cell of the column where you want the converted names to appear (C2).
- Manually type in or copy the text from column B2 into C2.
- Add the text “(MD)” after that.
- Under the Data tab, click on the Flash Fill or press CTRL+E on your keyboard (Command+E if you’re on a Mac).
That’s all, you get every cell filled in with the same pattern!
We especially like this method because it is simple, quick, and easy. Moreover, since it’s formula-free, the results do not depend on the original columns.
So they remain unchanged even if you delete rows A and B!
Method 4: Using VBA Code
And of course, if you’re comfortable with VBA, you can also add text before or after a text string using it.
Using VBA to Add Text to the Beginning of all Cells in a Column
If coding with VBA does not intimidate you then this method can help get your work done quickly too.
Here’s the code we will be using to add the title “Prof. “ to the beginning of all cells in a range. You can select and copy it:
Follow these steps to use the above code:
- From the Developer Menu Ribbon, select Visual Basic.
- Once your VBA window opens, Click Insert->Module. Now you can start coding. Type or copy-paste the above lines of code into the module window. Your code is now ready to run.
- Select the range of cells containing the text you want to convert. Make sure the column next to it is blank because this is where the code will display the results.
- Navigate to Developer->Macros-> add_text_to_beginning->Run.
You will now see the converted text next to your selected range of cells.
Note: You can change the text in line 6 from “Prof. ” to whatever text you need to add to the beginning of all cells.
Using VBA to Add Text to the End of all Cells in a Column
Now, what if you want to add text to the end of all the cells, instead of the beginning? This only involves making a tweak to line 6 of the above code. So if you want to add the text “ (MD)” to the end of all cells, change line 6 to:
cell.Offset(0, 1).Value = cell.Value & “ (MD)”
So your full code should now be:
Here’s the final result:
You can now delete the first two columns if you need to. Do remember to keep a backup of your sheet, because the results of VBA code are usually irreversible.
Note: You can change the text in line 6 from “ (MD)” to whatever text you need to add to the end of all cells in the range.
In this tutorial, we showed you four ways in which you can add text to the beginning and/ or end of all cells in a range.
There are plenty of other methods that you can find online too, and all of them work just as well as the ones shown here.
You may feel free to choose whatever method suits you, your requirement, and your version of Excel. In the end, what matters is getting what you need to be done quickly and effectively.
Other Excel tutorials you may like:
Источник
In this article, we will learn How to add cells in Excel.
Scenario :
Excel Add cells. Adding means two different things in excel either adding number values or joining text values. For example finding the sum of sales of a product. To add numbers we use the SUM function to directly add values or use + operator with numbers or cell references. For example Joining the First name and Last name into one cell with space. To join or combine two texts we use CONCATENATE function or & operator with text values or cell references. Let’s learn how to add cells in excel using both methods and sample data calculation to illustrate the usage.
Add number cells in Excel
To add numbers cells in excel using cell references you can use either of the two methods mentioned below.
- =SUM(A1, A2, A3) or =SUM(A1:A3).
- =A1 + A2 + A3
Add text cells in Excel
To add text cells in excel using cell references you can use either of the two methods mentioned below.
- =CONCATENATE(A2, B2, C2)
- =A2 & B2 & C2
Example :
All of these might be confusing to understand. Let’s understand how to use the function using an example. Here we have sample data to sum. And we need to add D2, D3, D4 cells. Just go to any cell and use the formula for the required cells.
Use the formula:
As you can see the sum of values in the D5 cell. You can use conditional summing using SUMIF or SUMIFS function.
Add two text cells in Excel
Here we are given two names and we need to add them to make a name out of it. Here the result expected is Tom & Jerry. To combine the two values
Use the formula:
=CONCATENATE(D2,» & «,E2) or =D2&» & «&E2
As you can see clearly the two cells are added in the new cell. Using the cell reference in excel. Use the TEXTJOIN function in Excel 365 (newer version) to add texts in excel directly.
Here are all the observational notes using the formula in Excel.
Notes :
- + and & are operators to add numbers or cells.
- Use cell reference wherever possible inplace of giving manual input in a formula.
Hope this article about How to add cells in Excel is explanatory. Find more articles on calculating values and related Excel formulas here. If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook. We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write to us at info@exceltip.com.
Related Articles :
Relative and Absolute Reference in Excel : Understanding of Relative and Absolute Reference in Excel is very important to work effectively on Excel. Relative and Absolute referencing of cells and ranges.
How to use the SUMPRODUCT function in Excel : Returns the SUM after multiplication of values in multiple arrays in excel.
SUM if date is between : Returns the SUM of values between given dates or period in excel.
Sum if date is greater than given date : Returns the SUM of values after the given date or period in excel.
2 Ways to Sum by Month in Excel : Returns the SUM of values within a given specific month in excel.
How to Sum Multiple Columns with Condition : Returns the SUM of values across multiple columns having condition in excel.
How to use wildcards in excel : Count cells matching phrases using the wildcards in excel.
How to Insert Row Shortcut in Excel : Use Ctrl + Shift + = to open the Insert dialog box where you can insert row, column or cells in Excel.
Popular Articles :
50 Excel Shortcuts to Increase Your Productivity : Get faster at your tasks in Excel. These shortcuts will help you increase your work efficiency in Excel.
How to use the IF Function in Excel : The IF statement in Excel checks the condition and returns a specific value if the condition is TRUE or returns another specific value if FALSE.
How to use the VLOOKUP Function in Excel : This is one of the most used and popular functions of excel that is used to lookup value from different ranges and sheets.
How to use the SUMIF Function in Excel : This is another dashboard essential function. This helps you sum up values on specific conditions.
How to use the COUNTIF Function in Excel : Count values with conditions using this amazing function. You don’t need to filter your data to count specific values. Countif function is essential to prepare your dashboard.
There may be instances where you need to add the same text to all cells in a column. You might need to add a particular title before names in a list, or a particular symbol at the end of the text in every cell.
The good thing is you don’t need to do this manually.
Excel provides some really simple ways in which you can add text to the beginning and/ or end of the text in a range of cells.
In this tutorial we will see 4 ways to do this:
- Using the ampersand operator (&)
- Using the CONCATENATE function
- Using the Flash Fill feature
- Using VBA
So let’s get started!
Method 1: Using the ampersand Operator
An ampersand (&) can be used to easily combine text strings in Excel. Let’s see how you use it to add text at the beginning or end or both in Excel.
Using the ampersand Operator to Add Text to the Beginning of all Cells
The ampersand (&) is an operator that is mainly used to join several text strings into one.
Here’s how you can use it to add text to the beginning of all cells in a range. Let us assume you have the following list of names and want to add the title “Prof.” before every name:
Below are the steps to add a text before a text string in Excel:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Type equal sign (=), followed by the text “Prof. “, followed by an ampersand (&).
- Select the cell containing the first name (A2).
- Press the Return Key.
- You will notice that the title “Prof.” is added before the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell B2). Alternatively, you can drag down the fill handle to achieve the same effect.
That’s it, all your cells in column B should now contain the title “Prof.” preceding each name.
Using the ampersand Operator to Add Text to the End of all Cells
Now let us see how to add some text to the end of every name in the dataset. Let us say you want to add the text “(MD)” at the end of every name. In that case, here are the steps you need to follow:
- Click on the first cell of the column where you want the converted names to appear (C2 in our case).
- Type equal sign (=)
- Select the cell containing the first name (B2 in our case).
- Next, insert an ampersand (&), followed by the text “ (MD)”.
- Press the Return Key.
- You will notice that the text “(MD).” added after the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell C2). Alternatively, you can drag down the fill handle to achieve the same effect.
All your cells in column C should now contain the text “(MD”) at the end of each name.
Method 2: Using the CONCATENATE Function
CONCATENATE is an Excel function that you can use to add text at the beginning and end of the text string.
Let’s see how to use CONCATENATE to do this.
Using CONCATENATE to Add Text to the Beginning of all Cells
The CONCATENATE() function provides the same functionality as the ampersand (&) operator. The only difference is in the way both are used.
The general syntax for the CONCATENATE function is:
=CONCATENATE(text1, [text2], …)
Where text1, text2, etc. are substrings that you want to combine together.
Let’s apply the CONCATENATE function to the same dataset as above:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Type equal sign (=).
- Enter the function CONCATENATE, followed by an opening bracket (.
- Type the title “Prof. ” in double-quotes, followed by a comma (,).
- Select the cell containing the first name (A2)
- Place a closing bracket. In our example, your formula should now be: =CONCATENATE(“Prof. “,A2).
- Press the Return Key.
- You will notice that the title “Prof.” is added before the first name on the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell B2). Alternatively, you can drag down the fill handle to achieve the same effect.
That’s it, all your cells in column B should now contain the title “Prof.” preceding each name.
Using CONCATENATE to Add Text to the End of all Cells
Now let us see how to add some text to the end of every name in the dataset. Let us say you want to add the text “(MD)” at the end of every name. In that case, here are the steps you need to follow:
- Click on the first cell of the column where you want the converted names to appear (C2 in our example).
- Type equal sign (=).
- Enter the function CONCATENATE, followed by an opening bracket (.
- Select the cell containing the first name (B2 in our example).
- Next, insert a comma, followed by the text “ (MD)”.
- Place a closing bracket. In our example, your formula should now be: =CONCATENATE(B2,” (MD)”).
- Press the Return Key.
- You will notice that the text “(MD).” added after the first name in the list.
- It’s now time to copy this formula to the rest of the cells in the column. Simply double click the fill handle (located at the bottom right of cell C2).
All your cells in column C should now contain the text “(MD”) at the end of each name.
Notice that since you’re using a formula, your column C depends on columns A and B. So if you make any changes to the original values in column A, they get reflected in column C.
If you decide to only retain the converted names and delete columns A and B, you will get an error, as shown below:
To make sure that this does not happen, it’s best to first convert the formula results to permanent values copying them and pasting them as values in the same column (Right-click and select Paste Options->Values from the Popup menu).
Now you can go ahead and delete columns A and B if you need to.
Also read: How to Remove First Character in Excel?
Method 3: Using the Flash Fill Feature
Flash fill is a relatively new feature that looks at the pattern of what you are trying to achieve and then does it for all the cells in a column.
You can also use Flash fill to so text manipulation as we will see in the following examples.
Using Flash Fill to Add Text to the Beginning of all Cells
The Excel flash fill feature is like a magical button. It is available if you’re on any Excel version from 2013 onwards.
The feature takes advantage of Excel’s pattern recognition capabilities. It basically recognizes a pattern in your data and automatically fills in the other cells of the column with the same pattern for you.
Here’s how you can use Flash Fill to add text to the beginning of all cells in a column:
- Click on the first cell of the column where you want the converted names to appear (B2).
- Manually type in the text Prof. , followed by the first name of your list.
- Press the Return Key.
- Click on cell B2 again.
- Under the Data tab, click on the Flash Fill button (in the ‘Data Tools’ group). Alternatively, you can just press CTRL+E on your keyboard (Command+E if you’re on a Mac).
This will copy the same pattern to the rest of the cells in the column… in a flash!
Using Flash Fill to Add Text to the End of all Cells in a Column
If you want to add the text “ (MD)” to the end of the names, follow the same steps:
- Click on the first cell of the column where you want the converted names to appear (C2).
- Manually type in or copy the text from column B2 into C2.
- Add the text “(MD)” after that.
- Under the Data tab, click on the Flash Fill or press CTRL+E on your keyboard (Command+E if you’re on a Mac).
That’s all, you get every cell filled in with the same pattern!
We especially like this method because it is simple, quick, and easy. Moreover, since it’s formula-free, the results do not depend on the original columns.
So they remain unchanged even if you delete rows A and B!
Method 4: Using VBA Code
And of course, if you’re comfortable with VBA, you can also add text before or after a text string using it.
Using VBA to Add Text to the Beginning of all Cells in a Column
If coding with VBA does not intimidate you then this method can help get your work done quickly too.
Here’s the code we will be using to add the title “Prof. “ to the beginning of all cells in a range. You can select and copy it:
Sub add_text_to_beginning() Dim rng As Range Dim cell As Range Set rng = Application.Selection For Each cell In rng cell.Offset(0, 1).Value = "Prof. " & cell.Value Next cell End Sub
Follow these steps to use the above code:
- From the Developer Menu Ribbon, select Visual Basic.
- Once your VBA window opens, Click Insert->Module. Now you can start coding. Type or copy-paste the above lines of code into the module window. Your code is now ready to run.
- Select the range of cells containing the text you want to convert. Make sure the column next to it is blank because this is where the code will display the results.
- Navigate to Developer->Macros-> add_text_to_beginning->Run.
You will now see the converted text next to your selected range of cells.
Note: You can change the text in line 6 from “Prof. ” to whatever text you need to add to the beginning of all cells.
Using VBA to Add Text to the End of all Cells in a Column
Now, what if you want to add text to the end of all the cells, instead of the beginning? This only involves making a tweak to line 6 of the above code. So if you want to add the text “ (MD)” to the end of all cells, change line 6 to:
cell.Offset(0, 1).Value = cell.Value & “ (MD)”
So your full code should now be:
Sub add_text_to_end() Dim rng As Range Dim cell As Range Set rng = Application.Selection For Each cell In rng cell.Offset(0, 1).Value = cell.Value & " (MD)" Next cell End Sub
Here’s the final result:
You can now delete the first two columns if you need to. Do remember to keep a backup of your sheet, because the results of VBA code are usually irreversible.
Note: You can change the text in line 6 from “ (MD)” to whatever text you need to add to the end of all cells in the range.
In this tutorial, we showed you four ways in which you can add text to the beginning and/ or end of all cells in a range.
There are plenty of other methods that you can find online too, and all of them work just as well as the ones shown here.
You may feel free to choose whatever method suits you, your requirement, and your version of Excel. In the end, what matters is getting what you need to be done quickly and effectively.
Other Excel tutorials you may like:
- How to Remove Text after a Specific Character in Excel
- How to Reverse a Text String in Excel
- How to Count How Many Times a Word Appears in Excel
- How to Remove Commas in Excel (from Numbers or Text String)
- How to Remove a Specific Character from a String in Excel
- How to Change Uppercase to Lowercase in Excel
- How to Separate Address in Excel?
- How to Concatenate with Line Breaks in Excel?
- How to Separate Names in Excel
This post will guide you how to insert character or text in middle of cells in Excel. How do I add text string or character to each cell of a column or range with a formula in Excel. How to add text to the beginning of all selected cells in Excel. How to add character after the first character of cells in Excel.
Assuming that you have a list of data in range B1:B5 that contain string values and you want to add one character “E” after the first character of string in Cells. You can refer to the following two methods.
Table of Contents
- 1. Insert Character or Text to Cells with a Formula
- 2. Insert Character or Text to Cells with VBA
- 3. Video: Insert Character or Text to Cells
- 4. Related Functions
1. Insert Character or Text to Cells with a Formula
To insert the character to cells in Excel, you can use a formula based on the LEFT function and the MID function. Like this:
=LEFT(B1,1) & "E" & MID(B1,2,299)
Type this formula into a blank cell, such as: Cell C1, and press Enter key. And then drag the AutoFill Handle down to other cells to apply this formula.
This formula will inert the character “E” after the first character of string in Cells. And if you want to insert the character or text string after the second or third or N position of the string in Cells, you just need to replace the number 1 in Left function and the number 2 in MID function as 2 and 3. Like below:
=LEFT(B1,2) & "E" & MID(B1,3,299)
You can also use an Excel VBA Macro to insert one character or text after the first position of the text string in Cells. Just do the following steps:
Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Step2: then the “Visual Basic Editor” window will appear.
Step3: click “Insert” ->”Module” to create a new module.
Step4: paste the below VBA code into the code window. Then clicking “Save” button.
Sub AddCharToCells() Dim cel As Range Dim curR As Range Set curR = Application.Selection Set curR = Application.InputBox("select one Range that you want to insert one character", "add character to cells", curR.Address, Type: = 8) For Each cel In curR cel.Value = VBA.Left(cel.Value, 1) & "E" & VBA.Mid(cel.Value, 2, VBA.Len(cel.Value) - 1) Next End Sub
Step5: back to the current worksheet, then run the above excel macro. Click Run button.
Step6: select one Range that you want to insert one character.
Step7: lets see the result.
3. Video: Insert Character or Text to Cells
This video will demonstrate how to insert character or text in middle of cells in Excel using both formulas and VBA code.
- Excel MID function
The Excel MID function returns a substring from a text string at the position that you specify.The syntax of the MID function is as below:= MID (text, start_num, num_chars)… - Excel LEFT function
The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…
In order to make sure that the data in your Excel file is organized in a way that makes sense, you will want to add some text to the beginning or end of all cells. This is not just for aesthetic purposes—it’s also important because it will help you keep track of what the data means.
In some cases, you may need to add text to the beginning of all cells in Excel. For example, if you have a list of addresses and you want to include each address with its corresponding city name, then adding Address or City to the beginning of all cells will be useful.
Information provided in this article are compatible with versions 2010/2016/MAC/online.
The CONCAT and CONCATENATE Function
CONCAT AND CONCATENATE function are very helpful if you wish to add a certain title in the beginning or end of a list. Here, I will show you an example of adding “Dr.” to the beginning of a list of names.
1. Type “=con” in the target cell and choose if you want to use the CONCAT or the CONCATENATE function. Double-click on the chosen function.
2. Type the argument as the text you want to add in inverted commas (“”) and choose the cell you wish to add after it.
3. Press enter.
4. It’s time to duplicate this formula in the remaining column’s cells. Just click twice on the fill handle or hold and drag it down (located at the bottom right of cell the here B2).
5. You can see that it adds the prefix you want to add to all the cells, as far as you drag down.
6. Alternatively, Ctrl+C (copy) and Ctrl+V (paste) on keyboard can be used for shorter lists, that is copying and pasting the formula onto other cells.
Adding Text Using Ampersand Operator (&)
1.The & operator can also be used to add text in the beginning or end of many cells. Let’s discuss an example where you need to add the percentage sybol (%) after a lot of numbers.
2. Just type in “=” and the formula as shown.
3. The result would look like this when you press enter.
4. If you want a space between the number and the symbol, you can go about two following ways:
5. Note that the space is added before the symbol.
6. To duplicate this formula in the remaining column’s cells, just click twice on the fill handle at the bottom-right corner of each cell or hold and drag it down. Or use Ctrl+C (copy) and Ctrl+V (paste) on keyboard for shorter lists.
The Flash Fill Option
1.If you wish to fill many cells with the same prefix, the Flash fill option can be very useful.
2. Under the ‘Data’ option in the main menu, a ‘Fill’ drop-down menu is availabele that has the ‘Flash Fill’ option.
3. Click on the text you want to fill onto the other cells and click on the Flash Fill option. The data will be copied onto the other cells related to the data. A shortcut of Flash Fill is Ctrl+E on keyboard.
Did you learn about How To Add Text To Beginning Or End Of All Cells In Excel? You can follow WPS Academy to learn more features of Word Document, Excel Spreadsheets and PowerPoint Slides.
You can also download WPS Office to edit the word documents, excel, PowerPoint for free of cost. Download now! And get an easy and enjoyable working experience.