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.

No comments: