MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Very Easy Question...

Posted by Steve on July 06, 2001 10:19 AM

I have 2 cells(a1,a2), first name and last name, how would i merge these cells into another cell a3 to say first , last?

Posted by Ben O. on July 06, 2001 10:24 AM

=A1 & " , " & A2

The & operator will combine expressions.

-Ben O.

Posted by Joe Was on July 06, 2001 10:50 AM


On sheet X where you need the data;
if the data is in Sheet "Y" Cell "A1" and "A2"! Then;

The trick is to reference the sheet name with a ! next to the Cell address or Range, like SheetY! or 'SheetY'! both work. The concatenation is done by space then "&" space with no quotes around the ampersand. You must add any formatting on your own!

If A1=123 and A2=Test then,

=A1 & A2 gives 123Test and
=A1 & "and" & A2 gives 123andTest
=A1 & " and " & A2 gives 123 and Test.

Try an "If test."
If A1=1 and B1=2 and C1=3 Then,

=If(AND(A1=B1,B1=C1),A1 & " " & B1 & " " & C1, "")
==> 1 2 3


==> 6

If the data is on a different sheet then the Sheet reference is: 'SheetY'!A1 in each reference above. JSW