Difference between two dates

  • Thread starter Thread starter tc
  • Start date Start date
T

tc

hi. i need to create a macro that will alow me to find the difference
in days between two given dates. is this possible?
thanks
 
if the dates are in A1 and B1, then

=MAX(A1,B1)-MIN(A1,B1)
 
Just subtract them

Dim Date1 as date
dim Date2 as date

date1 = dateserial(2007,12,25)
date2 = dateserial(2008,1,13)

msgbox date2 - date1 '+ 1

Is the 3rd - 1st a difference of 3 days or 2 days?
 
Why not just this...

=ABS(B1-A1)

instead?

Rick
 

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

Back
Top