What does the "&" do in a function?

R

Roger Govier

Hi

"&" is the concatenation character.
With Roger in A1 and Govier in B1
=A1&" "&B1
would produce Roger Govier
=A1&B1
would produce RogerGovier
 
G

Gord Dibben

It means the same as the CONCATENATE function but is much easier to type.

A1...........hello
B1...........world

=A1 & " " & B1 returns hello word

=CONCATENATE(A1," ",B1) returns hello world


Gord Dibben MS Excel MVP
 
J

JPreeshl

What does it mean in this function? With cell A1 having January in it.
=TEXT(DATE(0,MONTH(A1&"-0")+1,1),"mmmm")
 
P

Peo Sjoblom

The adds a month to a text representation of a month by converting the text
month in A1 to the first numerical day of the next month in year 1900. That
is what the date function does and the ampersand part returns "August-00" if
A1 contains August which is read as a numerical date by excel then it adds
one month, then it converts it to text again by wrapping the TEXT function
around it
So assuming A1 holds August the formula will return September

It is a clever way of adding a month to a text date

A shorter way


=TEXT(31+(A1&"-0"),"mmmm")


Regards,

Peo Sjoblom
 
R

Ragdyer

It means the same thing - "concatenate".

But, what it's doing here is changing a Text entry of the name of a month to
an XL recognized actual date value.

If you type
January
in A1 of a new, empty sheet, all you'll see in the formula bar is January.

Now click in A1 again and add
-0 (that's zero, *not* the letter O)
To the end of January, then see what happens in the cell and in the formula
bar.

The formula is doing exactly the same thing by adding (concatenating) the -0
to the text month name, making XL convert it to an actual date.
 
Top