Showing posts with label concatenation. Show all posts
Showing posts with label concatenation. Show all posts

Tuesday, 12 October 2010

Hannah says, how do I concatenate a date into a sentence?

Ah, glad to hear from you Hannah. And, as usual, an excellent question.
Here's the problem - if you want to produce a concatenated sentence (that's one where words or cell contents are merged together into one cell) then if you try and include a date it won't copy the date in properly.

So, for example, if I wanted to say "This quote is valid for 7 days from 12 October 2010" then I would probably try and go:
="This quote is valid for 7 days from "&L47

But it won't work - it will give a five figure serial code for the date instead of the actual date.

So, this is what you do instead:

="This quote is valid for 7 days from "&TEXT(L47,'dd mmmm yyyy')

And it'll work.

A note
  • if you want the date format 12-10-10 then go 'dd-mm-yy'
  • if you want the date format 12 Oct 10 then go 'dd mmm yy'
and so on.

Hannah says you don't get nothing for a pair, not in this game.

Tuesday, 15 December 2009

Hannah decides to do some concatenation

Concatenation is when you link stuff together in a cell.

For example, you might link cells A2 and B2 together using
=A2 &" " &B2
The ampersands (the & thingie) do the linking. The " " just adds a space between the two cell contents. If A2 and B2 had forename and surname in then that might produce a more useful cell to use.

There's an example of how to use concatenation to produce a cool and funky order number at That Blue Square Thing. Check it out, it's cool and funky and there are no chickens to be seen.

Hannah says concatenation is cool.

e2a: I've not thrown the macro code in as a screenshot as well. Just because I'm feeling kind.