Guest Trish Posted July 22, 2007 Posted July 22, 2007 Hi All, I have two cells having dates 30/6/07 & 31/5/07. I need the difference (no. of days) between these two days in a cell. Always I am getting the cell value in date format. How to get the value 30 as per the above example? Thanks for any replies. Trish
Guest Pegasus \(MVP\) Posted July 22, 2007 Posted July 22, 2007 Re: How to get the value 30 as per the example? "Trish" <nobodyknows@unknown.com> wrote in message news:OyqfGLKzHHA.3768@TK2MSFTNGP06.phx.gbl... > Hi All, > > I have two cells having dates 30/6/07 & 31/5/07. I need the difference > (no. > of days) between these two days in a cell. Always I am getting the cell > value in date format. How to get the value 30 as per the above example? > > Thanks for any replies. > > Trish Presumably you're talking about Excel, even though you never say so. If so then you should post your question in an Excel newsgroup.
Guest Gord Dibben Posted July 22, 2007 Posted July 22, 2007 Re: How to get the value 30 as per the example? Assuming you are running MS Excel you would have been better off posting to one of the Excel groups. But since I'm here I'll give you a formula. With earliest date in A2 and later date in A3 enter this in a cell. =DATEDIF(A2,A3,"d") returns 30 with your example data. To expand if you want years, months, days for longer periods. =DATEDIF(A2,A3,"y") & "years," & DATEDIF(A2,A3,"ym") & "months,"& DATEDIF(A2,A3,"md") & "days," DATEDIF function is undocumented in all versions of Excel except XL2000 Gord Dibben MS Excel MVP On Mon, 23 Jul 2007 02:26:20 +0530, "Trish" <nobodyknows@unknown.com> wrote: >Hi All, > >I have two cells having dates 30/6/07 & 31/5/07. I need the difference (no. >of days) between these two days in a cell. Always I am getting the cell >value in date format. How to get the value 30 as per the above example? > >Thanks for any replies. > >Trish > >
Recommended Posts