Excel Text Transformation Tricks

By David H. Ringstrom, CPA

Data arrives on your desk from multiple sources, and in many cases it's not quite in the format that you need. For instance, a user may have left the CAPS LOCK on while typing in a series of addresses. Or you've exported data from a program that pads fields with spaces at the beginning or end. Fortunately, there's no need to retype the list. Excel offers four easy-to-use functions that can quickly transform data into just the format that you need.

UPPER – As shown in Figure 1, this function transforms text into all upper case, so the phrase Old McDonald's Farm becomes OLD MCDONALD'S FARM. This function only has one argument, so you simply type =UPPER(x), where x is a cell that contains text you wish to convert.

LOWER – This function transforms text into all lower case letters, so Old McDonald's Farm becomes old mcdonald's farm. As with the UPPER function, you simply use the form =LOWER(x), where x is a cell that you wish to convert to lower case.

PROPER – This function capitalizes the first letter of each word, so the phrase old mcdonald's farm becomes Old Mcdonald'S Farm. This function takes the same form as the other functions: =PROPER(x), where x is the cell to convert. However, as you can see in Figure 1, PROPER can present problems in some cases:


  • The first D in McDonald's doesn't get capitalized.


  • The S in McDonald's is capitalized — in addition to capitalizing the first letter of a word, PROPER also capitalizes the next letter after an apostrophe or single quote.


  • Other items to look for are acronyms or initials, where ABC COMPANY would become Abc Company or BOB'S TV SERVICE would become Bob'S TV Service

You'll have to manually clear up problems like ABC or TV being converted to Abc and Tv, but you can use Excel's Replace function to clear up other problems, as I'll explain in a moment.

TRIM – Sometimes you'll inherit data that has extraneous spaces at the beginning, middle, or end of the string, such as " Old McDonald's Farm". In such cases you can use the TRIM function to strip out all extraneous spaces — the function automatically keeps one space between each word. The function takes the form =TRIM(x) where x is a cell reference.

Figure 1: These four functions can quickly transform text without retyping.


Expert tip: Sometimes it's helpful to have white space that the start of certain words, as shown in Figure 2. Rather than manually enter spaces at the start of cells A3 through A5, try this instead:


  1. Press Ctrl-1 to display the Format Cells dialog box.


  2. Click on the Alignment tab, and set the Indent field to 1 or 2.


  3. Click OK and your text will automatically indented, as shown in Figure 3.


  4. You can remove all of the indenting at any time by changing the Indent back to 0.

Figure 2: Use the Indent setting to move text to the right without using the spacebar.


Figure 3: Set the Indent level to 1 or 2 to create a slight indent.


Convert Formulas to Values

Typically when you use these functions you'll have data in one column, such as column A in Figure 1. You'll enter the formula in column B, and then copy it down the length of your list. Presto, your list is transformed, but don't rush off and delete column A just yet. You must first copy the formulas in column B to the clipboard, and then use the Paste Special command to convert the formulas to values:


  1. Copy the formulas to the clipboard.


  2. Right-click on the first cell that you copied, and then choose Paste Special.


  3. As shown in Figure 4, you can double-click on the word Values, or click once on Values and then click OK.

At this point you can delete the data in column A, because your converted data is in column B as text rather than formulas that refer to column A. If you forget to convert the formulas in column B to values before you delete column A, then you'll end up with a series of #REF! errors. Simply press Ctrl-Z to undo the column deletion, and then carry out the Paste Special Values command.

Figure 4: The Paste Special Values command converts formulas to text.


A PROPER Clean-up

Once you've converted your formulas to values, you can use the Replace function to resolve problems like that pesky 'S in McDonald'S. To do so, press Ctrl-H to display the Replace dialog box. As shown in Figure 5, enter 'S in the Find field, and 's in the Replace With field. Repeat this process for any other issues, like replacing Mcd with McD, Tv with TV, and so on.
Figure 5: Use the Replace command to quickly clean up capitalization problems that PROPER introduces.


Read more articles by David Ringstrom. 

About the author:

David H. Ringstrom, CPA heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at david@acctadv.com or follow him on Twitter. David speaks at conferences about Microsoft Excel, and presents webcasts for several CPE providers, including AccountingWEB partner CPE Link.


You may like these other stories...

Whenever I speak to accountants about creating a cloud practice, the most common question is, “How do I charge my clients?” Ten years ago, maybe even five years ago, if I would’ve posed this question...
While reputational risk is the No. 1 nonfinancial concern among corporate directors, cybersecurity/IT risk is gaining steam. In fact, both private companies and organizations with more than $1 billion in revenue felt they...
Accountants who specialize in forensic and valuation services point to electronic data analysis, or big data, as the most pressing issue they’ll face in the coming months, according to results of a new survey released...

Upcoming CPE Webinars

Jul 31
In this session Excel expert David Ringstrom helps beginners get up to speed in Microsoft Excel. However, even experienced Excel users will learn some new tricks, particularly when David discusses under-utilized aspects of Excel.
Aug 5
This webcast will focus on accounting and disclosure policies for various types of consolidations and business combinations.
Aug 20
In this session we'll review best practices for how to generate interest in your firm’s services.
Aug 21
Meet budgets and client expectations using project management skills geared toward the unique challenges faced by CPAs. Kristen Rampe will share how knowing the keys to structuring and executing a successful project can make the difference between success and repeated failures.