Display time in text

E

Elton Law

Dear expert,
Want to display date in 20090429. I go to format and choose YYYYMMDD.
It works. Then I use "concatenate" or "=A1&A2"
It becomes 39932. The fact is that I want to concatenate a file name and add
date at the back for saving purpose.
I have tried ...
=Year(A1)
=Month(A1)
=Date(A1)
But it gives 2009429 rather than 20090429.
I changed number format to 00.00 in order to display 04 for month. it works
for display only .... but concatenate ... it becomes 2009429 again.
Also, I have tried TEXT(A2,"00") and concatenate ... does not work too !
 
P

Pete_UK

Do it this way:

=A1 & TEXT(A2,"yyyymmdd")

assuming your filename is in A1 and the date in A2.

Hope this helps.

Pete
 
G

Gary''s Student

In A1 enter:
FileName
in A2 enter:
=TEXT(TODAY(),"yyyymmdd")

elsewhere enter:
=A1 & A2
to display:
FileName20090429
 
E

Elton Law

That's work ... Thanks a lot ....
Smart GUY !!!

Gary''s Student said:
In A1 enter:
FileName
in A2 enter:
=TEXT(TODAY(),"yyyymmdd")

elsewhere enter:
=A1 & A2
to display:
FileName20090429
 
J

Jacob Skaria

Replace Book1, Sheet1 and Sheet2 to suit your requirement

=COUNTIF([Book1]Sheet1!$A:$A,A2)+COUNTIF([Book1]Sheet2!$A:$A,A2)

If this post helps click Yes
 
J

Jacob Skaria

Sorry, the below is a wrong post..
--
If this post helps click Yes
---------------
Jacob Skaria


Jacob Skaria said:
Replace Book1, Sheet1 and Sheet2 to suit your requirement

=COUNTIF([Book1]Sheet1!$A:$A,A2)+COUNTIF([Book1]Sheet2!$A:$A,A2)

If this post helps click Yes
---------------
Jacob Skaria


Gary''s Student said:
In A1 enter:
FileName
in A2 enter:
=TEXT(TODAY(),"yyyymmdd")

elsewhere enter:
=A1 & A2
to display:
FileName20090429
 

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