PC Review


Reply
Thread Tools Rate Thread

how to calculate the substraction between two dates

 
 
=?iso-2022-jp?B?RVhDRUwbJEIhIRsoQk5FV1M=?=
Guest
Posts: n/a
 
      24th Aug 2004
hi,

i have two cells ,in which there are two dates.
(for instance ,one cel l 08/02 ,the other 07/30)

if the gap of the two dates is 2 days , something will be set to do.

but it is difficult to judge the the substraction between two dates

any good ideas.

thanks



 
Reply With Quote
 
 
 
 
Max
Guest
Posts: n/a
 
      24th Aug 2004
Perhaps this might be of help ..

Assume the *dates* "2-Aug-2004" and "30-Jul-2004"
are input in A1 and B1, and
A1:B1 is custom formatted as: mm/dd
viz. it'll show as:

In A1: 08/02
In B1: 07/30

Try in C1: =DAY(ABS(A1-B1))-1
Format C1 as: General or Number

C1 will return: 2
i.e. the number of days in-between the 2 dates in A1:B1
--
Rgds
Max
xl 97
---
Please respond in thread
xdemechanik <at>yahoo<dot>com
----
"EXCEL$B!!(BNEWS" <(E-Mail Removed)> wrote in message
news:#$lr$(E-Mail Removed)...
> hi,
>
> i have two cells ,in which there are two dates.
> (for instance ,one cel l 08/02 ,the other 07/30)
>
> if the gap of the two dates is 2 days , something will be set to do.
>
> but it is difficult to judge the the substraction between two dates
>
> any good ideas.
>
> thanks
>
>
>



 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      24th Aug 2004
> Try in C1: =DAY(ABS(A1-B1))-1


That method will work only if the difference between the two
dates is <= 31 days. Better to simply subtract one date from the
other, and format for General.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Max" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Perhaps this might be of help ..
>
> Assume the *dates* "2-Aug-2004" and "30-Jul-2004"
> are input in A1 and B1, and
> A1:B1 is custom formatted as: mm/dd
> viz. it'll show as:
>
> In A1: 08/02
> In B1: 07/30
>
> Try in C1: =DAY(ABS(A1-B1))-1
> Format C1 as: General or Number
>
> C1 will return: 2
> i.e. the number of days in-between the 2 dates in A1:B1
> --
> Rgds
> Max
> xl 97
> ---
> Please respond in thread
> xdemechanik <at>yahoo<dot>com
> ----
> "EXCEL$B!!(BNEWS" <(E-Mail Removed)> wrote in message
> news:#$lr$(E-Mail Removed)...
> > hi,
> >
> > i have two cells ,in which there are two dates.
> > (for instance ,one cel l 08/02 ,the other 07/30)
> >
> > if the gap of the two dates is 2 days , something will be set

to do.
> >
> > but it is difficult to judge the the substraction between two

dates
> >
> > any good ideas.
> >
> > thanks
> >
> >
> >

>
>



 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      24th Aug 2004
"Chip Pearson" <(E-Mail Removed)> wrote
> > Try in C1: =DAY(ABS(A1-B1))-1

>
> That method will work only if the difference between the two
> dates is <= 31 days. Better to simply subtract one date from the
> other, and format for General.


Yes, you're right.
Thanks for the correction, Chip
... I goofed, plain and simple ..
--
Rgds
Max
xl 97
--
Please respond, in newsgroup
xdemechanik <at>yahoo<dot>com
---


 
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
To Calculate the qty b/w two dates vmohan1978 Microsoft Excel Worksheet Functions 6 13th May 2009 12:20 AM
To Calculate the qty b/w two dates vmohan1978 Microsoft Excel Worksheet Functions 0 12th May 2009 10:00 AM
Calculate age between two dates nducamara Microsoft Access Reports 3 14th May 2008 01:59 PM
Calculate dates carolynnang Microsoft Excel Worksheet Functions 4 1st Oct 2004 01:25 PM
Calculating dates - Need to calculate years and months between source dates. jmw748 Microsoft Access Queries 2 7th Jan 2004 12:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:40 PM.