decimal year to date formula??

jbrandt

New Member
Joined
Jul 26, 2007
Messages
18
Hello all, I did some searching and couldn't find what I needed. Hope you can help.

I have 3 cells:
decimal year | year | day of year
2003.0247 | 2003 | 9

How do I convert this to a date? In the above example, return would be 1/9/2003

I know how to go from a date to decimal year using:

=TEXT((A1),"yyyy")+((A1)-DATE(YEAR(A1),1,0))/(DATE(YEAR(A1)+1,1,0)-DATE(YEAR(A1),1,0))

But how do I got the other way around?

Thanks!!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
First determine whether it's a leap year or not.
=IF(OR(MOD(INT(A1),400)=0,AND(MOD(INT(A1),4)=0,MOD(INT(A1),100)<>0)),366, 365)

Then take it from there....
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">1/9/2003</td><td style="text-align: right;;">2003.024658</td><td style="text-align: right;background-color: #FFFF99;;">1/9/2003</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">=YEAR(<font color="Blue">A1</font>)+(<font color="Blue">(<font color="Red">A1</font>)-DATE(<font color="Red">YEAR(<font color="Green">A1</font>),1,0</font>)</font>)/(<font color="Blue">DATE(<font color="Red">YEAR(<font color="Green">A1</font>)+1,1,0</font>)-DATE(<font color="Red">YEAR(<font color="Green">A1</font>),1,0</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">C1</th><td style="text-align:left">=DATE(<font color="Blue">INT(<font color="Red">B1</font>),1,MOD(<font color="Red">B1,1</font>)*(<font color="Red">DATE(<font color="Green">INT(<font color="Purple">B1</font>)+1,1,1</font>)-DATE(<font color="Green">INT(<font color="Purple">B1</font>),1,1</font>)</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">1/9/2003</td><td style="text-align: right;;">2003.024658</td><td style="text-align: right;background-color: #FFFF99;;">1/9/2003</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">=YEAR(<font color="Blue">A1</font>)+(<font color="Blue">(<font color="Red">A1</font>)-DATE(<font color="Red">YEAR(<font color="Green">A1</font>),1,0</font>)</font>)/(<font color="Blue">DATE(<font color="Red">YEAR(<font color="Green">A1</font>)+1,1,0</font>)-DATE(<font color="Red">YEAR(<font color="Green">A1</font>),1,0</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">C1</th><td style="text-align:left">=DATE(<font color="Blue">INT(<font color="Red">B1</font>),1,MOD(<font color="Red">B1,1</font>)*(<font color="Red">DATE(<font color="Green">INT(<font color="Purple">B1</font>)+1,1,1</font>)-DATE(<font color="Green">INT(<font color="Purple">B1</font>),1,1</font>)</font>)</font>)</td></tr></tbody></table></td></tr></table><br />

most excel-lent!!! (haha)

Thanks so much!!!
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top