Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default Difference in dates in Excel 2007

Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Difference in dates in Excel 2007

If you format the cells as General, do they have a fractional part? XL
stores date/times as integer/fractions, and calculations depend only on
the stored values, not the displayed values.

So, for instance, if

B1: 25 Sept 2007 23:59
B2: 23 Sept 2007 00:00
B3: =B1-B2 === 2.999305556

which will round to 3 if less than 3 decimals are specified.


In article ,
pcor wrote:

Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,268
Default Difference in dates in Excel 2007

Formatted yes but what do the cells contain?

Put this in D1 and copy down to D2

=TEXT(B1,"General")

or just format B3 as general



--


Regards,


Peo Sjoblom



"pcor" wrote in message
...
Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default Difference in dates in Excel 2007

It's 2 in mine. Are you sure you don't have times as well which takes it up
to 2.nnn such that it displays rounded up?
--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"pcor" wrote in message
...
Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks



  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default Difference in dates in Excel 2007

I guess I misled all of you in B1 I have turns out to ne 25
Sept 2007.
My question is this : What do I haveto do to get the answer 2
Thanks


"pcor" wrote:

Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks



  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Difference in dates in Excel 2007

How about:

B1: =TODAY()

instead?

In article ,
pcor wrote:

I guess I misled all of you in B1 I have turns out to ne 25
Sept 2007.
My question is this : What do I haveto do to get the answer 2

  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,268
Default Difference in dates in Excel 2007

Use TODAY() instead of NOW() or if you need NOW in some other calculation
use

=INT(B1)-INT(B2)



--


Regards,


Peo Sjoblom



"pcor" wrote in message
...
I guess I misled all of you in B1 I have turns out to ne 25
Sept 2007.
My question is this : What do I haveto do to get the answer 2
Thanks


"pcor" wrote:

Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks



  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default Difference in dates in Excel 2007

That did it real well. Many thanks to all
I really appreciate the good help I can get here. Thanks again


"Peo Sjoblom" wrote:

Use TODAY() instead of NOW() or if you need NOW in some other calculation
use

=INT(B1)-INT(B2)



--


Regards,


Peo Sjoblom



"pcor" wrote in message
...
I guess I misled all of you in B1 I have turns out to ne 25
Sept 2007.
My question is this : What do I haveto do to get the answer 2
Thanks


"pcor" wrote:

Cell b1= 25 Sept 2007
Cell b2= 23 Sept 2007
Both cells are formatted as shown
With the following formula in B3 (B1-b2) I get answer of 3. I thought the
answer would be 2.
Can you tell me why oir how to fix it
Thanks




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
Difference between dates Khurum Excel Worksheet Functions 12 August 13th 08 12:53 AM
Difference of two dates sajan chauhan Excel Discussion (Misc queries) 3 June 5th 07 04:47 AM
Difference between two dates Ashutosh Excel Discussion (Misc queries) 8 June 2nd 07 01:19 AM
Can excel calc the difference between 2 dates removing weekends? Adam Excel Discussion (Misc queries) 1 August 14th 06 06:50 AM
difference between dates Ankur Excel Discussion (Misc queries) 2 August 6th 06 05:16 PM


All times are GMT +1. The time now is 03:25 PM.

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"