Combining two dates

R

RyanR8881

I need to combine two columns. One column has the day and month, the other
column has the year. The CONCATENATE(D4,", ",E4) equation and the =D9&",
"&E9 equations dont work

again, it looks like this
l 26-Apr l 2007 l
l 27-Apr l 2007 l
l 28-Apr l 2007 l
 
D

David Biddulph

Just saying that the equations "dont work" is not a very helpful description
if you want help in solving your problems.
If you tell us what formula you used, what values were in the cells leading
into the formula, what result you got, and what result you expected, that
would be a good start.

One likely problem area if you are playing with dates is the question as to
whether the cells contain numbers formatted as dates or whether they contain
text. You can check this in a number of ways. One option is to use
=ISTEXT(D4) and =ISNUMBER(D4). Another option is to try Format/ Cells/
Number/ Date to see whether the cell can be changed from 26-Apr to display
temporarily in a different format such as 26/4/08 or 26 April 2008; if it
doesn't change, you're starting with text, but if it does change it is a
number formatted as text.

Having resolved the question above, if you have a number formatted as text
and you want to use it in a concatenation formula, you'll presumably want to
use the TEXT function to format it the way you want it.
So =CONCATENATE(D4,", ",E4) might become =CONCATENATE(TEXT(D4,"dd-mmm"),",
",E4)
or =D9&", "&E9 might become =TEXT(D9,"dd-mmm")&", "&E9
Change the formatting string "dd-mmm" to suit how you want the number
presented.
 
G

Gary''s Student

If the values in column D are not Text, then try:

=DATE(YEAR(E1),MONTH(D1),DAY(D1))
 
J

James

It can be done, it's long winded but works
First I made a lookup table on sheet 2
1 Jan
2 Feb
3 Mar
4 Apr
5 May
6 Jun
7 Jul
8 Aug
9 Sep
10 Oct
11 Nov
12 Dec
Then used this formula to get the results you need.
CONCATENATE(DAY(A1),"-",VLOOKUP(MONTH(A1),Sheet2!A$1:B$12,2),"-",B1)
With A1 containing your date and B1 the year. The problem came with the
month thus the lookup table.
Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top