Works: How to Append Text to Numbers in Spreadsheet or Database (107073)



The information in this article applies to:

  • Microsoft Works 3.0
  • Microsoft Works 4.5
  • Microsoft Works 4.5a
  • Microsoft Works for Windows 95, version 4.0
  • Microsoft Works for Windows 95, version 4.0 4.0a

This article was previously published under Q107073

SUMMARY

You can append text to numerical data within a spreadsheet cell or database field using a formula. This can be used to specify the units of the number (for example, "89.6 metric tons"), add additional information to the number (for example, "6.7 percent is our best increase ever"), and so on.

MORE INFORMATION

The formula needed to append text is as follows

=String(N,D)&"Text"

where:

N = The numerical data (or formula)
D = The number of decimal places desired for N
Text = Text to append (note that it must be in quotation marks)

As the number or formula "N" changes, the display with the appended text does also. The String function in the formula above converts the numerical data to a string and the "&" operator places the appended text at the end of the new string.

The following is an example:

  1. In a spreadsheet, type 20 in cell A1.
  2. In cell B1 type the following equation:

    =String(A1,2)&" points"

This will produce the following result in B1:

20.00 points

NOTE: If the equation is being used in a database, place the name of the field containing the numerical data in the place of A1 above.

Modification Type:MajorLast Reviewed:11/15/2004
Keywords:kbhowto KB107073