Difference between two dates rounded up.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to calculate the difference in two dates but in weeks. However
if the result is less than 1 week I would like the result rounded up to 1
week. Can anyone help I have had numerous attempts.
 
=IF(DATEDIF(A1,B1,"d")/7<1,1,DATEDIF(A1,B1,"d")/7)

Try this. Note that it will only round up the first week, weeks greater than
1 will be a decimal.

Mike
 
Hi Megan,

Assuming the dates are in A1 & A2, with A2 holding the later date:
=ROUNDUP((A2-A1)/7,0)
will round up the count of weeks to the next nearest week if less than a whole week. If you only want the first week rounded up,
try:
=MAX(1,ROUND((A2-A1)/7,0))

Cheers
 
Thank you so much. That works perfectly.

Mike said:
=IF(DATEDIF(A1,B1,"d")/7<1,1,DATEDIF(A1,B1,"d")/7)

Try this. Note that it will only round up the first week, weeks greater than
1 will be a decimal.

Mike
 
Thanks. This works much better as with the other formula I was having
problems when the dates were the same. Thanks again.

macropod said:
Hi Megan,

Assuming the dates are in A1 & A2, with A2 holding the later date:
=ROUNDUP((A2-A1)/7,0)
will round up the count of weeks to the next nearest week if less than a whole week. If you only want the first week rounded up,
try:
=MAX(1,ROUND((A2-A1)/7,0))

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

megan said:
I would like to calculate the difference in two dates but in weeks. However
if the result is less than 1 week I would like the result rounded up to 1
week. Can anyone help I have had numerous attempts.
 

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