Q+E: Unexpected Results with Mixed Alpha and Numeric Data

Last reviewed: September 12, 1996
Article ID: Q95386
The information in this article applies to:
  • Q+E for Microsoft Excel for Windows, versions 3.0 and 3.0a
  • Q+E for Microsoft Excel for OS/2, version 3.0

SUMMARY

When you open a Microsoft Excel database in Q+E for Microsoft Excel, if the same field in the first twenty-five records of your database contains mixed text and numeric values, the numeric values are displayed with additional decimal points. The text values are displayed correctly.

Also, if the same field of your database contains mixed text and numeric values but there are no text values in the first twenty-five records, the numeric values are displayed correctly but the text values are not displayed.

MORE INFORMATION

When you import a database from Microsoft Excel or a text file, Q+E scans the first twenty-five records of each field to determine the data type for that field. That is, if the first twenty-five records contain text in that field then Q+E considers it a text field; if the first twenty-five records contain numbers, then Q+E considers it a numeric field.

If the first twenty-five records of a field contain both text and numeric values, then Q+E considers it a text field and displays a number with a decimal point and two trailing zeros (nnn.00). If there are no text values in the first twenty-five records but there are text values in records after the first twenty-five, Q+E considers the field to be a numeric field.

For example, in a field containing 5-digit and 9-digit ZIP codes, if Q+E determines that the field is text, the 5-digit ZIP codes will be displayed with decimal points and trailing zeros. If the field is determined to be numeric, the 9-digit ZIP codes will not be displayed.

Workaround

To force Q+E for Microsoft Excel to display mixed numeric and text values in a field, ensure that the field is formatted as text, and that all values are recognized by Q+E as text values.

To ensure that all values are recognized as text, do one of the following:

  • Format all your data as text in Excel before opening the file in Q+E.

    -or-

  • Save your Excel file in the comma-separated values (CSV) file format. (Saving your file as a CSV file formats all of your data as text.)

To format data as text in Microsoft Excel

  1. Open your database file in Microsoft Excel.

  2. Insert a new empty column directly to the right of the column containing your mixed data. This column will temporarily hold the formulas that convert your mixed data to all text.

  3. In the newly inserted (temporary) column, select the cell in the first record (that is, the first row below your database headings).

  4. Type the following formula:

           =TEXT(<cell_ref>,"#")
    

    where, <cell_ref> is the reference to the first cell below your headings in the field you want to convert to text (the column to the left of your temporary column).

  5. Copy this formula down the temporary column as far as necessary to convert all the data in the field. This can be done easily by dragging the fill handle of the first cell (containing the formula) down as needed.

  6. With the cells containing your formula in the temporary column still highlighted, choose Copy from the Edit menu.

  7. From the Edit menu, choose Paste Special.

  8. In the Paste Special dialog box, choose the Values option in the Paste group. This replaces your formulas with equivalent text values.

  9. Copy your newly created text values and paste them over the old mixed text and numeric values in the original column, then delete the temporary column.

Repeat steps 3 through 9 for all columns that you need to convert to text.

To save your file as in the CSV file format

  1. Open your file in Microsoft Excel.

  2. From the File menu, choose Save As.

  3. In the Save As dialog box, choose CSV from the Save File As Type list.

  4. Choose the OK button.

Because this procedure converts all of your data to text, it may not be the best method if you have columns of numbers that you want to retain as numbers; although, after you open your file in Q+E, you can change fields from text to numeric as needed.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 4.00 db q plus e



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.