How to replace the last comma with and in cells in Excel?
Supposing there is a cell containing content of "Group member includes Nana, Linda, Natalia, Jim", how can you replace the last comma with "and" and change the cell content to "Group member includes Nana, Linda, Natalia and Jim"? This article will show you a method to solve this problem.
Replace the last comma with and in cells with formula
Replace the last comma with and in cells with formula
The following formula can help you to replace the last comma with and in cells. Please do as follows.
1. Select a blank cell for placing the result. Then enter formula =SUBSTITUTE(A2,","," and",LEN(A2)-LEN(SUBSTITUTE(A2,",",""))) into the Formula Bar and then press the Enter key. See screenshot:
Note: In the above formula, A2 is the cell contains the content you need to replace the last comma. Please change it as you need.
2. Keep selecting the resulting cell, then drag the Fill Handle down to get all results.
You can see all last commas in specified cells are replaced with the word of “and” as below screenshot shown.
Related article:
- How to replace commas with newlines (Alt + Enter) in cells in Excel?
- How to add comma at end of cell/text in Excel?
- How to remove all commas in Excel?
- How to split comma separated values into rows or columns in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!