
How do you convert a date to a year?
I have dates in an excel file, I am trying to convert them to just a year format. For instance, I am trying to go from say… march 5, 1983 to.. for instance, something like.. 1983.2145. I am going to put these numbers in the Matlab Software. Does anyone know how to do this conversion in matlab or excel? I fooled around with the dates as a number, for instance march 8, 2010 being.. 40245, any ideas? thanks
as in if it was jan,1 of 1980, the year would read 1980.0, if it was july 1 of 80, it would be 1980.5, in other words, if it was the 34th day of the year 1978, it would be 1978+(34/365.24)
I don’t understand the .2145 bit. What does that represent? It can’t be a fraction of a year, because March 5 would be about 0.175.
You can extract the year from any date:-
=YEAR(A1)
You can then treat that number like any other number, or convert it to text
=TEXT(YEAR(A1),”#”)
MATLAB Virtual Conference 2010
Related Articles
No user responded in this post
Leave A Reply