concatenate formulas

K

kyleblack21

I am using a concatenate formula to combine many cells to this text string in
one cell. The number "4.05589430894309" needs to rounded to the first
number after the decimal and "1.022556390977" needs to be a percentage. The
cells these two numbers come from are in the appropriate formats. Yet when
they go into this format below, they loose their originating formats.

How do I write the formula so the formulas get transported with the correct
formats?

John Doe exercise for 2minutes and 26 seconds reaching stage 3 using a
Accelerate Bruce protocol, achiveing an estimated workload of
4.05589430894309 METs. This corresponded to a functional capacity of Average
for the patients age and sex. The heart rate was 70 bpm at baseline, and
increased to 136 bpm at peak exercise, representing 1.02255639097744 of
age-predicted maximal heart rate. The blood pressure response was
hypotensive. Resting blood pressure was 120/80 mmHg, and peak blood pressure
was 210/98 mmHg.
How do I
 
T

Tom Ogilvy

for a worksheet formula:
A1: 4.05589430894309
a2: 1.022556390977

= "blah blah " & Text(dblA,"0.0") & " blah blah" & Text(dblB,"0%") & " blah
blah"

adjust the format strings to get the exact effect you want.

In vba:

dblA = 4.05589430894309
dblB = 1.022556390977
s = "blah blah " & format(dblA,"0.0") & " blah blah" & format(dblB,"0%") & "
blah blah"
 
D

daddylonglegs

Try using the TEXT function within your concatenation, e.g.

=TEXT(A1,"0.0%") or

=TEXT(A1,"0.0")
 

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

Top