Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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 "megan" wrote: 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. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you so much. That works perfectly.
"Mike" wrote: =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 "megan" wrote: 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. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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" wrote in message ... 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. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks. This works much better as with the other formula I was having
problems when the dates were the same. Thanks again. "macropod" wrote: 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" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
difference between dates | Excel Discussion (Misc queries) | |||
difference between dates | Excel Discussion (Misc queries) | |||
difference between dates | Excel Discussion (Misc queries) | |||
difference between dates | Excel Discussion (Misc queries) | |||
difference between two dates | Excel Discussion (Misc queries) |