Link to home
Start Free TrialLog in
Avatar of Bill Golden
Bill GoldenFlag for United States of America

asked on

Putting the value of another cell in an Excel text cell.

Ok, I have totally lost it.  
Simple example of what I need.
In A1 I have a color, say blue
In A2 I want to end up with the following text: The blue cow jumped over the fence.
A2 looks like this...
="The "&A1" "cow jumped over the moon."
I am getting an error.  Why?
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill Golden

ASKER

Building on that example...
Simple example of what I need.
In A1 I have a name, say Bill
In A2 I want to end up with the following text: It was Bill's cow who jumped over the moon.
A2 looks like this...
="It was "&A1&""'s cow that jumped over the moon."
I am getting an error.  Why?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Last part, I promise...
Simple example of what I need.
In A1 I have a name, say Bill
In A2 I want to end up with the following text: It was Bill's cow who jumped over the "blue" moon.
A2 looks like this...
="It was "&A1&"'s cow that jumped over the "blue" moon."
I realize I need to do something to use something around the quotes that surround the word blue, but what?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it.  I was obviously born missing a syntax gene, but learning.  Thanks everyone.
Try using SUBSTITUTE:

In A1: Bill
In B1: It was [name]'s cow that jumped over the "blue" moon.
In C1: =SUBSTITUTE(B1,"[name]",A1)

This will replace [name] in the sentence of B1 with the contents of A1.
Avatar of Kanti Prasad
Kanti Prasad

All you need is an &TRIM(A?)&

" your info "  &TRIM(A?)&  " your info" & TRIM(A?)& "your info"
replace ? with the cell number

So for eg  if you have Blue in cell A1 and Bill in cell A3 then in A2


="It was" &TRIM(A3)& "cow who jumped over the " &TRIM(A1)&" moon."
I have been "hoisted by my own pitard" since this is part of a paragraph and that makes it too long.  Starting a new question.
"petard" actually. :)
Your right of course.  Not only is my sense of syntax bad, my spelling seems to be adrift!