PC Review


Reply
Thread Tools Rate Thread

How to convert day of a year

 
 
Nateysz
Guest
Posts: n/a
 
      8th Mar 2011
Hello,

I have sheet where date is expressed as day of a year.
I know that converting from day-month-year into day of a year is quite
easy, but I don't know how to do this in other direction.

I have tried to write multiple if confitions, but it's generating many
errors.
Is there any convenient way of doing it (maybe macro ?)
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      8th Mar 2011
> I have sheet where date is expressed as day of a year.
> I know that converting from day-month-year into day of
> a year is quite easy, but I don't know how to do this in
> other direction.


I would think you are looking for this...

=DATE(YEAR(NOW()),1,<<DayOfYear>>)

where you would put the number of the "day of year" or a cell reference
containing it.

Rick Rothstein (MVP - Excel)

 
Reply With Quote
 
Stan Brown
Guest
Posts: n/a
 
      8th Mar 2011
On Tue, 08 Mar 2011 08:20:13 +0100, Nateysz wrote:
> I have sheet where date is expressed as day of a year.
> I know that converting from day-month-year into day of a year is quite
> easy, but I don't know how to do this in other direction.
>
> I have tried to write multiple if confitions, but it's generating many
> errors.
> Is there any convenient way of doing it (maybe macro ?)


If the day-of-year is in A1 and the year is in A2, then use this
formula:

=date(A2, 1, A1)

Excel will take e.g. the 364th day of January and convert it to
December 30 (or 29, in leap years).

I've tested this in Excel 2010, but AFAIK it works in earlier Excels
too.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
 
Reply With Quote
 
Nateysz
Guest
Posts: n/a
 
      9th Mar 2011
> If the day-of-year is in A1 and the year is in A2, then use this
> formula:
>
> =date(A2, 1, A1)
>
> Excel will take e.g. the 364th day of January and convert it to
> December 30 (or 29, in leap years).
>
> I've tested this in Excel 2010, but AFAIK it works in earlier Excels
> too.


It works even in Open Office Calc.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert day of year to numeric value format year+day in 4 digits Kaaren Microsoft Excel Worksheet Functions 3 7th Feb 2009 08:37 PM
Convert day, month, year, and time to just year bam Microsoft Excel Discussion 6 20th Jul 2007 05:26 PM
Convert date to year =?Utf-8?B?VGFuZHk=?= Microsoft Access Queries 4 29th Dec 2006 11:39 PM
how do I convert a dates in a year quarters in a year? =?Utf-8?B?TGlubmRlaw==?= Microsoft Excel Misc 2 11th May 2006 03:33 PM
Convert year JaR Microsoft Excel Discussion 6 24th Sep 2003 09:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:34 PM.