Days between 2 dates

L

Linda RQ

Hi Everyone,

Using Excel 2003. What function or formula would I use in Cell C1 to get
the count number of days between these two dates. If the time in Cell A1 is
PM, we don't want that day counted.

Cell A1
5/30/06@2:15am

Cell B1
6/19/06@6:16pm

Thanks,
Linda
 
S

Sloth

=INT(B1-C1)

you will have to format the cell as a number after putting in the formula.
 
S

Sloth

Ooops I meant to say...
=INT(B1-A1)
but that's not really what you want is it? Try this one
=DATEDIF(A1,B1,"D")-(HOUR(A1)>11)
 
B

Bob Phillips

Why not just

=INT(B1-A1)-(HOUR(A1)>11)

but reading the OP, perrhaps it should be

=INT(B1-A1)+(HOUR(A1)<=11)



--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
S

Sloth

It really depends on the OP's preference really. Look at the following
examples to see why I went with DATEDIF...

5/30/2006 2:15 AM
6/19/2006 1:15 AM
=INT(B1-A1) -> 19
=DATEDIF(A1,B1,"D") -> 20

5/30/2006 2:15 AM
6/19/2006 3:15 AM
=INT(B1-A1) -> 20
=DATEDIF(A1,B1,"D") -> 20
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top