Best way to insert value in a setenecne

G

Guest

Excel 2003.

If in one cell I have the following statement: "Last week I ate [ x ]
apples"

And I wanted to insert a number from another cell into [ x ]. How would I
do that?

I tried have the first part of the setence one one cell. The " [ x ] " in
the second cell and the rest of the sentence in the third. But because of
other things going on in the sheet I cannot get it to line up correctly. What
are my options?
 
D

Dave Peterson

="Last week I ate " & a1 & " apples."

or if you need formatting:

="Last week I ate " & TEXT(A1,"#,##0") & " apples." & CHAR(10) &
"I paid " & TEXT(B1,"$#,##0.00") & " for them on " &
TEXT(C1,"mm/dd/yyyy") & "."

char(10) wraps the text
But you'll have to use format|Cells|alignment tab|Check wrap text
Excel 2003.

If in one cell I have the following statement: "Last week I ate [ x ]
apples"

And I wanted to insert a number from another cell into [ x ]. How would I
do that?

I tried have the first part of the setence one one cell. The " [ x ] " in
the second cell and the rest of the sentence in the third. But because of
other things going on in the sheet I cannot get it to line up correctly. What
are my options?
 
G

Guest

Another way that doesn't require a helper cell, is to just format the cell as
Custom,
"Last week I ate "#" apples" and just type the number in the same
cell...........

Vaya con Dios,
Chuck, CABGx3
 
R

Rick Rothstein \(MVP - VB\)

Excel 2003.
If in one cell I have the following statement: "Last week I ate [ x ]
apples"

And I wanted to insert a number from another cell into [ x ]. How would I
do that?

I tried have the first part of the setence one one cell. The " [ x ] " in
the second cell and the rest of the sentence in the third. But because of
other things going on in the sheet I cannot get it to line up correctly.
What
are my options?

Assuming the "apple" sentence was illustrative and that you wanted a
generalize solution, try this...

=SUBSTITUTE(A1,"[ x ]",A2)

where your sentence containing "[ x ]" is located in A1 and the other cell
containing your number is assumed to be A2.

Rick
 

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