#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Dates in Excel 2007

Using Excel 2007 data has been imported from Crystal Reports into an Excel
2007 spreadsheet. Column D is Proc Date; column J is Confirm Date. Column L
is used to calculate the difference between the two dates, L2 = J2 - D2.
Column L is formatted with a general number to show the number of days
between the two dates. While the Proc Date is available the Confirm Date is
not always available, so the cell is blank. In the calculation, L2, the numer
that is returned is -40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way to prevent
a default date from being inserted when there is none so that ##### shows in
the calculated cell?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Dates in Excel 2007

= IF(COUNT(D2,J2)=2,J2 - D2,"")
or
= IF(OR(D2="",J2=""),"",J2 - D2)
--
David Biddulph

Basenji wrote:
Using Excel 2007 data has been imported from Crystal Reports into an
Excel 2007 spreadsheet. Column D is Proc Date; column J is Confirm
Date. Column L is used to calculate the difference between the two
dates, L2 = J2 - D2. Column L is formatted with a general number to
show the number of days between the two dates. While the Proc Date is
available the Confirm Date is not always available, so the cell is
blank. In the calculation, L2, the numer that is returned is -40190,
indicating that it is taking January 1, 1900, and subtracting January
12, 2010. Is there a setting or some other way to prevent a default
date from being inserted when there is none so that ##### shows in
the calculated cell?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Dates in Excel 2007

=IF(J1<"",J1-D1,"####")


"Basenji" wrote:

Using Excel 2007 data has been imported from Crystal Reports into an Excel
2007 spreadsheet. Column D is Proc Date; column J is Confirm Date. Column L
is used to calculate the difference between the two dates, L2 = J2 - D2.
Column L is formatted with a general number to show the number of days
between the two dates. While the Proc Date is available the Confirm Date is
not always available, so the cell is blank. In the calculation, L2, the numer
that is returned is -40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way to prevent
a default date from being inserted when there is none so that ##### shows in
the calculated cell?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Dates in Excel 2007

Thanks for the formula. It address the negative number for the difference of
the two dates. However, is there a way to prevent Excel from "assuming" a
date of January 1, 1900, when no date is entered?

"Atif" wrote:

=IF(J1<"",J1-D1,"####")


"Basenji" wrote:

Using Excel 2007 data has been imported from Crystal Reports into an Excel
2007 spreadsheet. Column D is Proc Date; column J is Confirm Date. Column L
is used to calculate the difference between the two dates, L2 = J2 - D2.
Column L is formatted with a general number to show the number of days
between the two dates. While the Proc Date is available the Confirm Date is
not always available, so the cell is blank. In the calculation, L2, the numer
that is returned is -40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way to prevent
a default date from being inserted when there is none so that ##### shows in
the calculated cell?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Dates in Excel 2007

Thank you for the formulas. They provide a solution for the negative number
for the difference of the two dates when the one date is missing. However, is
there a way to prevent Excel from "assuming" a date of January 1, 1900, when
no date is entered?


"David Biddulph" wrote:

= IF(COUNT(D2,J2)=2,J2 - D2,"")
or
= IF(OR(D2="",J2=""),"",J2 - D2)
--
David Biddulph

Basenji wrote:
Using Excel 2007 data has been imported from Crystal Reports into an
Excel 2007 spreadsheet. Column D is Proc Date; column J is Confirm
Date. Column L is used to calculate the difference between the two
dates, L2 = J2 - D2. Column L is formatted with a general number to
show the number of days between the two dates. While the Proc Date is
available the Confirm Date is not always available, so the cell is
blank. In the calculation, L2, the numer that is returned is -40190,
indicating that it is taking January 1, 1900, and subtracting January
12, 2010. Is there a setting or some other way to prevent a default
date from being inserted when there is none so that ##### shows in
the calculated cell?



.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Dates in Excel 2007

Yes, that's what either of my 2 formulae will do for you. 1 January 1900 is
the Excel date for a value of zero. If you don't want it to use that value
of zero, you need to tell Excel not to do the arithmetic with that cell in
that situation. If you tell Excel to do the arithmetic, and if the value in
the cell is zero, then it is treated as 1 January 1900.
--
David Biddulph


Basenji wrote:
Thank you for the formulas. They provide a solution for the negative
number for the difference of the two dates when the one date is
missing. However, is there a way to prevent Excel from "assuming" a
date of January 1, 1900, when no date is entered?


"David Biddulph" wrote:

= IF(COUNT(D2,J2)=2,J2 - D2,"")
or
= IF(OR(D2="",J2=""),"",J2 - D2)
--
David Biddulph

Basenji wrote:
Using Excel 2007 data has been imported from Crystal Reports into an
Excel 2007 spreadsheet. Column D is Proc Date; column J is Confirm
Date. Column L is used to calculate the difference between the two
dates, L2 = J2 - D2. Column L is formatted with a general number to
show the number of days between the two dates. While the Proc Date
is available the Confirm Date is not always available, so the cell
is blank. In the calculation, L2, the numer that is returned is
-40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way
to prevent a default date from being inserted when there is none so
that ##### shows in the calculated cell?



.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Dates in Excel 2007



"David Biddulph" wrote:

Yes, that's what either of my 2 formulae will do for you. 1 January 1900 is
the Excel date for a value of zero. If you don't want it to use that value
of zero, you need to tell Excel not to do the arithmetic with that cell in
that situation. If you tell Excel to do the arithmetic, and if the value in
the cell is zero, then it is treated as 1 January 1900.
--
David Biddulph


Basenji wrote:
Thank you for the formulas. They provide a solution for the negative
number for the difference of the two dates when the one date is
missing. However, is there a way to prevent Excel from "assuming" a
date of January 1, 1900, when no date is entered?


"David Biddulph" wrote:

= IF(COUNT(D2,J2)=2,J2 - D2,"")
or
= IF(OR(D2="",J2=""),"",J2 - D2)
--
David Biddulph

Basenji wrote:
Using Excel 2007 data has been imported from Crystal Reports into an
Excel 2007 spreadsheet. Column D is Proc Date; column J is Confirm
Date. Column L is used to calculate the difference between the two
dates, L2 = J2 - D2. Column L is formatted with a general number to
show the number of days between the two dates. While the Proc Date
is available the Confirm Date is not always available, so the cell
is blank. In the calculation, L2, the numer that is returned is
-40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way
to prevent a default date from being inserted when there is none so
that ##### shows in the calculated cell?


.



.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Dates in Excel 2007

Thank you for the explanation. It is helpful when dealing with dates in
calculations.

"David Biddulph" wrote:

Yes, that's what either of my 2 formulae will do for you. 1 January 1900 is
the Excel date for a value of zero. If you don't want it to use that value
of zero, you need to tell Excel not to do the arithmetic with that cell in
that situation. If you tell Excel to do the arithmetic, and if the value in
the cell is zero, then it is treated as 1 January 1900.
--
David Biddulph


Basenji wrote:
Thank you for the formulas. They provide a solution for the negative
number for the difference of the two dates when the one date is
missing. However, is there a way to prevent Excel from "assuming" a
date of January 1, 1900, when no date is entered?


"David Biddulph" wrote:

= IF(COUNT(D2,J2)=2,J2 - D2,"")
or
= IF(OR(D2="",J2=""),"",J2 - D2)
--
David Biddulph

Basenji wrote:
Using Excel 2007 data has been imported from Crystal Reports into an
Excel 2007 spreadsheet. Column D is Proc Date; column J is Confirm
Date. Column L is used to calculate the difference between the two
dates, L2 = J2 - D2. Column L is formatted with a general number to
show the number of days between the two dates. While the Proc Date
is available the Confirm Date is not always available, so the cell
is blank. In the calculation, L2, the numer that is returned is
-40190, indicating that it is taking January 1, 1900, and
subtracting January 12, 2010. Is there a setting or some other way
to prevent a default date from being inserted when there is none so
that ##### shows in the calculated cell?


.



.

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
Excel 2007 displayed dates JohnD30 Excel Discussion (Misc queries) 2 December 16th 09 04:39 PM
Using Dates in Excel 2007 Mary Ellis Excel Worksheet Functions 1 June 18th 08 08:03 AM
Excel 2007 comparing dates Jeri Excel Discussion (Misc queries) 5 May 8th 08 04:08 PM
Problems with dates in Excel 2007 [email protected] Excel Discussion (Misc queries) 3 March 4th 08 12:05 PM
Difference in dates in Excel 2007 pcor New Users to Excel 7 September 25th 07 09:14 PM


All times are GMT +1. The time now is 12:17 AM.

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

About Us

"It's about Microsoft Excel"