ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   I'd like to add a suffix... (https://www.excelbanter.com/excel-discussion-misc-queries/31386-id-like-add-suffix.html)

Dr. Darrell

I'd like to add a suffix...
 
I would like to add a suffix <<< "hrs" to some fields. The fields are the
result of Formulas <<< "=SUM(C11:C42)" I would like the field to be
displayed as the resultant number (49) & the desired text (hrs) = 49 hrs.

Is there a means to do this?


Domenic

Try...

=SUM(C11:C42)&" hrs"

Hope this helps!

In article ,
"Dr. Darrell" wrote:

I would like to add a suffix <<< "hrs" to some fields. The fields are the
result of Formulas <<< "=SUM(C11:C42)" I would like the field to be
displayed as the resultant number (49) & the desired text (hrs) = 49 hrs.

Is there a means to do this?


Earl Kiosterud

Dr.,

Probably the best way to add your suffix is with the number formatting of
the cell. With the cells selected, Format - Cells - Number - Custom.
append the following to whatever is in the box:

" hrs"

If there are semicolons in the current formatting stuff, put the above in
front of each semicolon, as well as at the end. If this doesn't work, post
back with the current formatting code, and we'll go from there.

With this method, your total remains a number, which can be used by other
formulas if needed.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Dr. Darrell" wrote in message
...
I would like to add a suffix <<< "hrs" to some fields. The fields are
the
result of Formulas <<< "=SUM(C11:C42)" I would like the field to be
displayed as the resultant number (49) & the desired text (hrs) = 49 hrs.

Is there a means to do this?




Don Guillett

try this
Sub addsuffix()
For Each c In Selection
'to leave formula and add suffix
If Left(c.Formula, 1) = "=" Then c.Formula = c.Formula & "&" & """ hrs"""
'or this line to leave the value only
'If Left(c.Formula, 1) = "=" Then c.Value = c & " hrs"
Next
End Sub

--
Don Guillett
SalesAid Software

"Dr. Darrell" wrote in message
...
I would like to add a suffix <<< "hrs" to some fields. The fields are

the
result of Formulas <<< "=SUM(C11:C42)" I would like the field to be
displayed as the resultant number (49) & the desired text (hrs) = 49 hrs.

Is there a means to do this?




Dr. Darrell

Earl:

Thank you, that was very simple and very helpful.

Darrell

"Earl Kiosterud" wrote:

Dr.,

Probably the best way to add your suffix is with the number formatting of
the cell. With the cells selected, Format - Cells - Number - Custom.
append the following to whatever is in the box:

" hrs"

If there are semicolons in the current formatting stuff, put the above in
front of each semicolon, as well as at the end. If this doesn't work, post
back with the current formatting code, and we'll go from there.

With this method, your total remains a number, which can be used by other
formulas if needed.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Dr. Darrell" wrote in message
...
I would like to add a suffix <<< "hrs" to some fields. The fields are
the
result of Formulas <<< "=SUM(C11:C42)" I would like the field to be
displayed as the resultant number (49) & the desired text (hrs) = 49 hrs.

Is there a means to do this?






All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com