Microsoft KB Archive/107073: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 48: Line 48:
== SUMMARY ==
== 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.
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.


</div>
</div>
Line 58: Line 58:
<div class="indent">
<div class="indent">


=String(N,D)&amp;&quot;Text&quot;
=String(N,D)&amp;"Text"




Line 71: Line 71:


</div>
</div>
As the number or formula &quot;N&quot; 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 &quot;&amp;&quot; operator places the appended text at the end of the new string.<br />
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 "&amp;" operator places the appended text at the end of the new string.<br />
<br />
<br />
The following is an example:<br />
The following is an example:<br />
Line 81: Line 81:
<div class="indent">
<div class="indent">


<p>=String(A1,2)&amp;&quot; points&quot;</p>
<p>=String(A1,2)&amp;" points"</p>


</div></li></ol>
</div></li></ol>

Revision as of 10:11, 20 July 2020

Knowledge Base


Works: How to Append Text to Numbers in Spreadsheet or Database

Article ID: 107073

Article Last Modified on 11/15/2004



APPLIES TO

  • Microsoft Works 3.0 Standard Edition
  • Microsoft Works 4.5 Standard Edition
  • Microsoft Works 4.5a
  • Microsoft Works 4.0 Standard Edition
  • Microsoft Works 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.

Keywords: kbhowto KB107073