Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ron
 
Posts: n/a
Default compute days between dates

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two dates.
This does not work with the two colums in my worksheet that has the hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

It shouldn't matter the least, a cell with a formula that produces a date or
a hardcoded date would be the same and testing using your fromulas I don't
get an error, my guess is that the source formula somehow gives an error and
an error will always be transferred . Btw there is no need using DATEDIF for
days, a simple =C27-B27 is enough, just format result as general or else you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two dates.
This does not work with the two colums in my worksheet that has the hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron

  #3   Report Post  
Ron
 
Posts: n/a
Default

Thank you Peo,
I changed to your simpler format and now I get the number 36534, how do I
make that the difference of 9 days? I have formatted the cell to a general
number.
Cols
A b c D
5001 01/01/05 01/10/05 36534
Thanks for your help and patience!
--
Ron


"Peo Sjoblom" wrote:

It shouldn't matter the least, a cell with a formula that produces a date or
a hardcoded date would be the same and testing using your fromulas I don't
get an error, my guess is that the source formula somehow gives an error and
an error will always be transferred . Btw there is no need using DATEDIF for
days, a simple =C27-B27 is enough, just format result as general or else you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two dates.
This does not work with the two colums in my worksheet that has the hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron

  #4   Report Post  
S. Stone
 
Posts: n/a
Default

Format as a Number with no decimal places.


"Ron" wrote:

Thank you Peo,
I changed to your simpler format and now I get the number 36534, how do I
make that the difference of 9 days? I have formatted the cell to a general
number.
Cols
A b c D
5001 01/01/05 01/10/05 36534
Thanks for your help and patience!
--
Ron


"Peo Sjoblom" wrote:

It shouldn't matter the least, a cell with a formula that produces a date or
a hardcoded date would be the same and testing using your fromulas I don't
get an error, my guess is that the source formula somehow gives an error and
an error will always be transferred . Btw there is no need using DATEDIF for
days, a simple =C27-B27 is enough, just format result as general or else you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two dates.
This does not work with the two colums in my worksheet that has the hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron

  #5   Report Post  
Fred Smith
 
Posts: n/a
Default

Excel stores dates as the number of days since Jan 1, 1900. That's why you
can simply subtract one date from another to get the difference in days.

36534 is Jan 9, 2000. So you have a difference of 9 days and 100 years.
Excel must think that your first date is in the 20th century, and your
second date is in the 21st.

Format columns B and C to have 4 digit years, so you can see which century
Excel considers them to be in. I know where column B comes from (it's
converting the Julian date in column A), but where does C come from? My bet
is that, for some reason, Excel thinks the date in column C is 01/01/2005,
whereas the date in column B is 01/10/1905. If so, one simple workaround is
to change my Julian date conversion formula to
=date(int(a1/1000)+100,1,mod(a1,1000))

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Ron" wrote in message
...
Thank you Peo,
I changed to your simpler format and now I get the number 36534, how do I
make that the difference of 9 days? I have formatted the cell to a general
number.
Cols
A b c D
5001 01/01/05 01/10/05 36534
Thanks for your help and patience!
--
Ron


"Peo Sjoblom" wrote:

It shouldn't matter the least, a cell with a formula that produces a date
or
a hardcoded date would be the same and testing using your fromulas I
don't
get an error, my guess is that the source formula somehow gives an error
and
an error will always be transferred . Btw there is no need using DATEDIF
for
days, a simple =C27-B27 is enough, just format result as general or else
you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the
result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two
dates.
This does not work with the two colums in my worksheet that has the
hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use
this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron





  #6   Report Post  
Ron
 
Posts: n/a
Default

Thank YOU Fred!!!
This has been a tremendous help to me! You were exactly right and it
convertted from 20 to 21st century! Thank YOU!
--
Ron


"Fred Smith" wrote:

Excel stores dates as the number of days since Jan 1, 1900. That's why you
can simply subtract one date from another to get the difference in days.

36534 is Jan 9, 2000. So you have a difference of 9 days and 100 years.
Excel must think that your first date is in the 20th century, and your
second date is in the 21st.

Format columns B and C to have 4 digit years, so you can see which century
Excel considers them to be in. I know where column B comes from (it's
converting the Julian date in column A), but where does C come from? My bet
is that, for some reason, Excel thinks the date in column C is 01/01/2005,
whereas the date in column B is 01/10/1905. If so, one simple workaround is
to change my Julian date conversion formula to
=date(int(a1/1000)+100,1,mod(a1,1000))

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Ron" wrote in message
...
Thank you Peo,
I changed to your simpler format and now I get the number 36534, how do I
make that the difference of 9 days? I have formatted the cell to a general
number.
Cols
A b c D
5001 01/01/05 01/10/05 36534
Thanks for your help and patience!
--
Ron


"Peo Sjoblom" wrote:

It shouldn't matter the least, a cell with a formula that produces a date
or
a hardcoded date would be the same and testing using your fromulas I
don't
get an error, my guess is that the source formula somehow gives an error
and
an error will always be transferred . Btw there is no need using DATEDIF
for
days, a simple =C27-B27 is enough, just format result as general or else
you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is the
result
of converting a Julian Date (col A) to the calendar date, so there is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the two
dates.
This does not work with the two colums in my worksheet that has the
hidden
formula. The answer I get is #NAME? (this is the formula behind cell B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and use
this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron




  #7   Report Post  
Fred Smith
 
Posts: n/a
Default

You're welcome. Thanks for the feedback.

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Ron" wrote in message
...
Thank YOU Fred!!!
This has been a tremendous help to me! You were exactly right and it
convertted from 20 to 21st century! Thank YOU!
--
Ron


"Fred Smith" wrote:

Excel stores dates as the number of days since Jan 1, 1900. That's why
you
can simply subtract one date from another to get the difference in days.

36534 is Jan 9, 2000. So you have a difference of 9 days and 100 years.
Excel must think that your first date is in the 20th century, and your
second date is in the 21st.

Format columns B and C to have 4 digit years, so you can see which
century
Excel considers them to be in. I know where column B comes from (it's
converting the Julian date in column A), but where does C come from? My
bet
is that, for some reason, Excel thinks the date in column C is
01/01/2005,
whereas the date in column B is 01/10/1905. If so, one simple workaround
is
to change my Julian date conversion formula to
=date(int(a1/1000)+100,1,mod(a1,1000))

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Ron" wrote in message
...
Thank you Peo,
I changed to your simpler format and now I get the number 36534, how do
I
make that the difference of 9 days? I have formatted the cell to a
general
number.
Cols
A b c D
5001 01/01/05 01/10/05 36534
Thanks for your help and patience!
--
Ron


"Peo Sjoblom" wrote:

It shouldn't matter the least, a cell with a formula that produces a
date
or
a hardcoded date would be the same and testing using your fromulas I
don't
get an error, my guess is that the source formula somehow gives an
error
and
an error will always be transferred . Btw there is no need using
DATEDIF
for
days, a simple =C27-B27 is enough, just format result as general or
else
you
probably get date format

Regards,

Peo Sjoblom

"Ron" wrote:

I have two columns (B & C) of dates (mm/dd/yy). The first colmn is
the
result
of converting a Julian Date (col A) to the calendar date, so there
is a
formula hidden in cell B under the date. I am using the formula
=DATEDIF(B27,C27,"d") to determine the number of days between the
two
dates.
This does not work with the two colums in my worksheet that has the
hidden
formula. The answer I get is #NAME? (this is the formula behind cell
B
=DATE(INT(C3/1000),1,MOD(C3,1000)) ).
If I put a date in col b (not a result of a formula from Col A) and
use
this
formula(=DATEDIF(B27,C27,"d") ) it works. Example 2
I am guessing the hidden formula is messing up my work?
I am using Excel 2000

EX. 1
Cols
A b c D
5001 01/01/05 01/10/05 #NAME?

Ex 2
A
Blank 01/01/05 01/10/05 9
--
Ron






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Brainteaser about Days Between Dates Johnny Excel Discussion (Misc queries) 5 April 4th 05 05:09 AM
formula to calculate # of days between dates, excluding holidays abs2299 Excel Discussion (Misc queries) 8 March 3rd 05 02:21 AM
how do I calculate the days between dates? stucklady! Excel Discussion (Misc queries) 7 February 12th 05 04:39 PM
Find number of days between to dates Qaspec Excel Worksheet Functions 1 January 21st 05 12:14 AM
Subracting Dates to come up with the # of days between them KimberlyC Excel Worksheet Functions 8 December 20th 04 09:46 PM


All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"