Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / Office / MS-Excel

String Concatention In Excel Formulae

0.00/5 (No votes)
23 Dec 2009CPOL 11.9K  
How to do string concatenation in Excel formulae

A little known but shockingly useful feature of Excel is that you can stick strings together using the & operator in formulae.

My wife asked me how to make a column which has only the month and year from a date column in it. For example:

12/06/2009 -> 6/2009

One might think this was rather challenging and try and find some complex mathematical approach. However, the solution is stupidly simple:

If you're date is in A1 then:
=month(A1) & "/" & year(A1)

This works because the & concatenates (sticks together) strings. The formula considers month(A1), "/" and year(A1) all to be strings and just makes them into one big string.

Once you get the idea, there are many other things which can be done this easy way rather than having to put in too much work!

Also posted on 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)