Date-error Format

M

Mia

I´m trying to do a sheet make o new date format. The new format should be
yyyymmdd. I have 2008-07-01 (yyyy-mm-dd), but it responds 20080001.
The formula I´m using are =TEXT(cell; "ååååmmdd"), do anyone know what´s
wrong?

BR
Mia
 
D

Dave Peterson

Your sample formula is kind of messed up by the special characters in that
formatting string.

Are you sure you use yyyy to indicate years in the =text() formula?

If you're not using an English version of excel, you'll want to share what
you're using.

I'd use this (in the USA):

=text(a1,"yyyymmdd")
or
=text(a1;"yyyymmdd")
(with the semicolon as the list separator)

You may want to type a date in a cell, then use format|Cells|number tab
and choose special and then use the equivalent of:
yyyymmdd
 
M

Mia

I'm using at swedish version of Excel and I´m writing the Swedish characters
ååååmmdd, it´s the same for yyyymmdd.


Dateformat 20080715 gets
=TEXT(H12;"yyyy") answer 2008
=TEXT(H12;"dd") answer 15
=TEXT(H12;"mm") answer 00

//
Mia



"Dave Peterson" skrev:
 
D

Dave Peterson

You sure that Swedes don't use jjjj for the year.

Your post still has lots of funny characters for me.
 
M

Mia

I can see that you get a lot of strange characters. I´m usin the right ones but
it get this reslut that I cant solve.

"Dave Peterson" skrev:
 
D

Dave Peterson

I don't speak Swedish, but shouldn't your formula look more like:

=tekst(h12;"jjjj")


I can see that you get a lot of strange characters. I´m usin the right ones but
it get this reslut that I cant solve.

"Dave Peterson" skrev:
 
R

Ron de Bruin

In the Netherlands we use

jjjj

j = jaar

Use what this macro tell you instead of y

Sub test()
MsgBox Application.International(xlYearCode)
End Sub
 
M

Mia

Thank yoy both!

I changed to capital letters and then it work!

BR
Mia



"Ron de Bruin" skrev:
In the Netherlands we use

jjjj

j = jaar

Use what this macro tell you instead of y

Sub test()
MsgBox Application.International(xlYearCode)
End Sub
 

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