Textual Variants | AccountingWEB

Textual Variants

One of the more frequent requests I get is how to convert a text file into viable Excel data that can be pivoted? There are a wide variety of text files. I call them textual variants, and there are different methods used to refine the file depending on the variant. The first example is a common one. This is an accounts receivable aging file. The basic problem here is that a header line appears first which identifies the customer name. All of the other pertinent information (date, invoice number, amount, etc.) is contained in subsequent lines. Then there is a break and the cycle repeats itself. This file has to be manipulated so the customer name is on the same line as the rest of the data in order to make a data base which is suitable to pivot. A manual insertion of a column and manual entry of the customer name followed by copying the name down through all of the data rows is one option, but this is not a good option if the file is thousands of rows deep. Usually these files can be easily adapted using a combination of text functions, IF functions and/or the special paste feature in the “Go To” dialog box.

Here is how the file appears when it is imported into Excel (click to enlarge):

Figure 2 (click to enlarge):

The key is to find an identifier. The identifier is some unique feature be it a format, symbol, blank, etc. that allows the user to differentiate something in one row from another row in the same column. Now find a unique feature about row 4 (data row) that is not contained in row 3 (header row). Examine column A first. This column contains the customer number for the header row and an invoice number for the data row. Notice that these rows are not unique. The customer name can be either a number such as cells A3 and A22 or a label such as cells A7 or A11. It could be that all invoices begin with an “8” whereas no customer numbers begin with an “8”. Then the first digit of the number in column A might be a viable option to use as the “identifier”, but we don’t have enough information from this screen shot to know if this is true. Now look at columns B, C & D. Notice that the header row always contains a label and the data row always contains a number or a date, and a date is a number in Excel. Any one of these columns would make a perfect “identifier”.

Now insert a column before column A and write an IF function. The syntax of an IF function is to first perform a logical test i.e. a function that is answered by true or false. If true, the IF function will perform the next function (part 2 of the IF) and ignore the last function (part 3 of the IF). If false the IF function will ignore the next function (part 2 of the IF) and perform the last function (part 3 of the IF).

Click to enlarge:

Now copy the IF formula down to the bottom of the data, and see what happens.

When copied using relative references the formula in cell A4 became =IF(ISNUMBER(D4),A3,C4&D4)
It found a number in cell D4 and returned the value in cell A3, namely ALAMO GROUP.
Then the formula in cell A6 did not find a number and returned the values in cells C6 & D6, blanks.
Likewise the formula in cell A7 found a label and returned ALEXANDRIA TUBES, and so on.

The effect is to record the customer name on each row that contains the rest of the data.

Now it’s time to set up the column headers. There is some more work to do as the row headers and blank lines have to be deleted.

It is a good idea to copy this sheet to preserve the procedures and formulas that have been mastered for this particular text file. Now the formula can be easily accessed from Nov(1). AR Aging (1) and copied into next month’s file.

First, highlight the IF functions in column A and paste special values so that the formulas are erased and the text remains.

Next, sort the data. Here I used invoice, and I was able to isolate the row headers from the row data.

Delete the extraneous row headers and blanks. Do not delete the totals until the remaining data columns have been summed and compared to the totals. This is a good check as sometimes there are nuances and blips in the data that can cause some information to be lost or accidentally deleted.

Viola, The result is a perfect data base just waiting to be pivoted.

Well the temperature hit zero degrees here yesterday. With the wind chill it seemed like about 150 below, and as my brother in Maine said “It’s wicked cold”, so I’m headed to sunny Florida tomorrow for a brief respite from the bitter weather. I want to wish all my readers a save and happy holiday season. Rest assured, there’s more Excel excitement to come in 2009.

This blog

by Chris Wood, CPA - Chris Wood is a CPA with experience in Big Four, large regional and local public accounting firms. Write to the good Captain on everything under the sun concerning the captivating world of Excel!



More from this blog

Bloggers crew

Steve Knowles has spent 25 years in business and practice in the UK, but he also worked in the states and the years haven't dulled his way of seeing an alternative view to everyone else, and every day is a new adventure.


Joel M. Ungar, CPA is a lifelong resident of the Detroit area and a graduate of The University of Michigan. He is a principal with Silberstein Ungar, PLLC, a Top 15 auditor of SEC public reporting companies.


Allan Boress, CPA, with over 25 years as a practitioner and consultant to the accounting profession. Mr. Boress is the author of 12 published books in 6 different languages, including a best-seller, The "I-Hate-Selling" Book.


Larry Perry, CPA, CPA Firm Support Services, LLC, is the author of accounting and auditing manuals, author and presenter of live staff training seminars, and author of webcast and self-study CPE programs. He blogs about small audits, reviews, and compilations.

Sandra Wiley, COO and Shareholder, is ranked by Accounting Today as one of the 100 Most Influential People in Accounting as a result of her prominent role as an industry expert on HR and training as well as influence as a management and planning consultant. She is also a founding member of The CPA Consultant's Alliance. Sandra is a certified Kolbe™ trainer who advises firms on building balanced teams, managing employee conflict and hiring staff.

Maria Calabrese, CIR, Human Resources manager for Fazio, Mannuzza, Roche, Tankel, LaPilusa, LLC in Cranford, New Jersey, Maria's topics revolve around the world of: Mentoring, Performance management, and The "Y Generation," a.k.a. "The whY generation".


William Brighenti is a CPA, Certified QuickBooks ProAdvisor, and Certified [Business] Valuation Analyst, operating an accounting, tax, and QuickBooks consulting firm in Hartford, Connecticut, Accountants CPA Hartford.


Ken Garen, CPA, is the co-founder and President of Universal Business Computing Company (www.ubcc.com), a software development firm of high-volume, high-productivity accounting and payroll technology.


Eva Rosenberg, MBA, EA, is the publisher of TaxMama.com, and author of the weekly syndicated Ask TaxMama column. She provides answers to tax questions from taxpayers and tax professionals worldwide.


Amy Vetter, CPA, CITP is the CPA Programs Leader for Intacct Corporation responsible for leading the CPA/BPO Partners nationally.

Brian Strahle is the owner of LEVERAGE SALT, LLC where he provides state and local tax technical services to accounting firms, law firms and tax research organizations across the United States. He also writes a weekly column in Tax Analysts State tax Notes entitled, "The SALT Effect." For more info, visit his website: www.leveragestateandlocaltax.com
Scott H. Cytron, ABC, is president of Cytron and Company, known for helping companies and organizations improve their bottom line through a hybrid of strategic public relations, communications, marketing programs and top-notch client service. An accredited consultant, Scott works with companies, organizations and individuals in professional services (accounting, finance, medical, legal, engineering), high-tech and B2B/B2C product/service sales.

Rita Keller is a nationally known CPA firm management consultant, speaker, author, mentor and blogger. She has over 30 years hands-on experience in CPA firm management, marketing, technology and administrative operations.

Stacy Kildal is the mom of two fantastic kids, an Advanced Certified QuickBooks ProAdvisor, Certified Enterprise Solutions ProAdvisor, Sleeter Group Certified Consultant, a nationally recognized member of the Intuit Trainer and Writer Network, and co-host of RadioFree QuickBooks.
Michael Alter's blog specializes in providing practical advice to those who seek greater profitability and practice management tactics that enhance deeper client relationships.

Sally Glick, CMO, Principal, Marketer of the Year in 2003 and AAM Hall of Famer in 2007, leads a lively discussion of the constantly expanding roles of marketing and the professional marketers that drive this initiative in accounting firms of all sizes.


The IMA Young Professionals Blog features the insights of IMA’s Young Professionals Committee. Committee members share advice and experiences on careers, continuing education, work/life balance, and other issues affecting young accounting and finance professionals.


FEI Financial Reporting Blog provides highlights from SEC, PCAOB, FASB, IASB, and other regulatory news, including reporting under Sarbanes-Oxley Sect 404. It is written by Edith Orenstein, Director of Technical Policy Analysis at FEI.


Sue Anderson has 30 years of experience in continuing education for accountants. Currently she is the program director for online CPE provider CPE Link.


Jim Fahey is COO of Apple Growth Partners, a regional CPA firm in Ohio. His focus is on the effective and efficient use of technology within the firm by all team members.

Caleb Newquist is the Editor-in-Chief of Sift Media US, overseeing content for both AccountingWEB and Going Concern.

Leita Hart-Fanta, CPA, CGFM, and CGAP is the author of "The Yellow Book Interpreted" and owner of Yellowbook-CPE.com a website devoted to training for governmental auditors.


AccountingWEB is more than just a U.S. team of journalists and financial and technology experts - we have an international side, too! Members of our British team who publish AccountingWEB.co.uk share their ideas, insights, and perspectives from across the pond.