Forum Discussion
sum function with text
- total noob here...
- after a quick search, i didn't find anything on this...
i want to do a sum formula, but i also want to add text to the cell after the sum is completed.
is there a way to add this to the formula?
do i just do the sum formula, then go back and add the text to the box or will that throw an error?
do i just add the text to the cell next to the formula?
thanks in advance!
1 Reply
- SnowMan55Bronze Contributor
I will mention two ways of doing this.
(The first techniques results in a text value in the cell.) Formulas can take mutiple actions before generating results. Commonly, that is done with nested functions (a function wrapped around another function, using the output of the latter as one of its arguments).
Formula example,
=TEXT( SUM(A3:D3), "#,##0" ) & " items in total"
(The spaces inside the TEXT function are optional.)
(The second technique keeps the value in the cell as a number. This can be useful if you want the result to be used in other formulas.) You can use a custom number format to show text in front of (or behind) the displayed number.
Custom format example:
#,##0" items in total"
(I'm assuming a non-negative sum, with no (fractional) decimal digits. The format string would be different if you need to handle negative values or values with decimal digits.)