Link to home
Start Free TrialLog in
Avatar of hermesalpha
hermesalphaFlag for Paraguay

asked on

Can I use custom format and still have the contents count as date?

Now the dates look like this: 2009-11-04. And the cells are formatted as date. I want to change to custom format to dispaly 20091104. Can I just do that in Excel 2007, go to custom format and enter "YYYYMMDD" and the contents will still count as date?
Avatar of Alan
Alan
Flag of New Zealand image

Hi hermesalpha,

The format and the underlying value should be entirely independent.

So, yes - you can do as you set out, and it will still be a date.

Just to note, that dates are really just numbers anyway - being the number of days since 1 Jan 1900 (unless you have explicitly chosen to use the 1904 option for compatibility with Lotus 123 - not something I have seen for a long time now, maybe pushing twenty years).

Therefore, 4 Nov 2009 is really a value of 40121.


Alan.
As Alan said, yes you can change the custom format of a date and excel will still treat it as a Date as the underlying cell content will not be changed..
Excel treats Dates as real numbers so to check whether a date is actually a date not a date as text, assuming your date is in A2, place the following formula in a blank cell and if it returns True that means the date in A2 is a real date else the date in A2 is date entered as a text string.

=ISNUMBER(A2)

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.