Dates and Time

B

Brian

I would like to know how to write a formula in Excel if a wish to find out if the difference between two dates is divisible by 7

To be more specific, if today's date is April 12th, 2004 (stored in Excel as 38089) and the other date is May 3rd, 2004 (stored in Excel as 38110), the difference between the two dates is 21 days. 21 is divisible by 7. How do a write a formula to see if 21 is divisible by 7

This would tell me that April 12th and May 3rd are both Monday's

thanks
Brian
 
F

Frank Kabel

Hi Brian
one way (A1 and A2 store your dates):
=IF(MOD(A2-A1,7)=0,"divisible by 7","not divisible by 7")

but if you need to check the weekday use the WEEKDAY function:
=IF(WEEKDAY(A2)=2,"Monday","a different day")
 
M

mzehr

Hi Brian,
One way is to use the formula =WEEKDAY(A63,1) which will
tell you what day of the week the day was in cell a63. or
if you really want to find out if the difference between
two dates is divisible by 7 use =IF(MOD((A64-A63)/7,1)
=0,"","Not Divisible by 7")

For an excellent resource on date difference see the Chip
Pearson's web site:

http://www.cpearson.com/excel/datedif.htm

HTH
-----Original Message-----
I would like to know how to write a formula in Excel if a
wish to find out if the difference between two dates is
divisible by 7?
To be more specific, if today's date is April 12th, 2004
(stored in Excel as 38089) and the other date is May 3rd,
2004 (stored in Excel as 38110), the difference between
the two dates is 21 days. 21 is divisible by 7. How do a
write a formula to see if 21 is divisible by 7?
 
Top