When retrieving an XLS file generated directly from the print to file option included in all Advanced Accounting versions from 6 through 7i (see printing to a file in Advanced Accounting) as well as upcoming release 8, numeric data may be initially formatted as "text" rather than as numbers. In order to use the data in calculations, this text data can be easily converted from text to numbers via a few steps depending on the spreadsheet program that is used. The discussion that follows outlines options available in OpenOffice Calc and Microsoft Excel to accomplish this task.
First, here's a preview of a sample report generated out of upcoming Advanced Accounting 8's enhanced sales tax analysis report grouping sales by month:
The discussion below involves retrieving the XLS file generated from this report and converting some of the columns to numbers.
OpenOffice Calc:
In OpenOffice, a leading apostrophe denotes text formatting.
Rather then edit the cells individually, after retrieving the XLS file (click on File then Open and navigate to where the file was saved), first select and format all cells to numeric (not currency) with two decimal place precision.
Note: a convenient way to select cells is to simply click on the first cell and then hold the SHIFT key and use down and ultimately right arrows. Then click on Format then Cells to get the option above.
Without unselecting the cells, do a Find and Replace (click on Edit and then Find and Replace, or CTRL-F) .
Search for:
^.
(i.e. input the caret or exponent symbol produced via Shift-6 followed by a period)
Replace with:
&
(i.e. an ampersand character, Shift-7)
Click on More options if the option list is not already expanded and make sure that "Regular expressions" is checked.
Click on Replace All, then Close.
All of the selected cells are now numeric.
The above procedure works in OpenOffice 2, 3 as well as the recently released 4.
Microsoft Excel:
There are many different versions of Excel, each of which may offer different approaches to accomplish this task. A general reference document can be found here: How to convert text to numbers in Excel.
The "text to column" approach is one method (Method 7 in the link above), although it only works in selecting one column at a time and is not as convenient as in the OpenOffice Calc example. Here is an example using Excel 2010 and this method.
Select one column of text that contains numbers.
Under the Data menu or tab, choose Text to Columns.
Choose Delimited, click on Next and choose Tab and again click on Next.
Choose General for the column data format. Via the Advanced button, the decimal and separator options can be made, and then click Finish.
Repeat for each column.
No comments:
Post a Comment