My formula is =Sum(E38). How can I add text to the formula?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I add text to a formula in a cell. Example: The cell now is
=Sum(E38). How can I add to the beginning of the formula so that the
following words appear in the same cell The Number of Occurences Reported is
 
Hi Marie,

="The Number of Occurences Reported is "&SUM(E38)

or

="The Number of Occurences Reported is "&E38

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| How can I add text to a formula in a cell. Example: The cell now is
| =Sum(E38). How can I add to the beginning of the formula so that the
| following words appear in the same cell The Number of Occurences Reported is
| --
| Marie
 
You could also just use a formula like:

=E38
but give that cell a custom format
Format|cells|Number tab|Custom category:
"The Number of Occurences Reported is "0
Or if you like commas:
"The Number of Occurences Reported is "#,##0

By using the custom format, the value in the cell will still be a number. And
you can do more calculations with it if you want.
 
="The Number of Occurences Reported is " & E38
You don't need SUM

That's what I also used to say. Then I realized that when E38
contains text, =SUM(E8) results in zero, whereas =E38 results in the
text. Likewise, =SUM(A1,A2) works, whereas =A1+A2 results in a #VALUE
error if A1 or A2 contains text. If the purpose is to always produce
a numeric result, there is a difference.

On the other hand, arguably =N(E38) is more to the point than
SUM(E38). And I see no value in some of the more debatable uses of
SUM(), e.g. SUM(A1+A2).

Marie, you might want to consider the following:

="The number of occurrences is " & text(n(E38), "0")

if you want to control the format of E38 in the formula. "#" would
result in a blank if E38 is zero or text; "0" ensures at least a
zero. On the other hand, no such format control is necessary if you
are sure that E38 will be an integer (or text).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top