Jump to content

How to get the value 30 as per the example?


Recommended Posts

Guest Trish
Posted

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

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

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

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

>

>


×
×
  • Create New...