date spreadsheet

JGarza

Board Regular
Joined
Mar 26, 2002
Messages
93
I am trying to calculate the number of weeks from one date to another (ie how many weeks are there between 3/03/01 thru 8/1/02)

Does anyone know a formula?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi,

You might want to try using the following formula:

=(B1-A1+1)/7

where B1 = end date, A1 = start date.

HTH
 
Upvote 0
This will break-out a full date:

=IF(F24="","Please Enter Your Date Above!",DATEDIF(F24,NOW(),"y")&" years, "&DATEDIF(F24,NOW(),"ym")&" months and "&DATEDIF(F24,NOW(),"md")&" days")

Note: You need the analyze addin that comes with Excel installed to work it.

The date data is in "F24" the formula can be in any cell. You can strip out the other parts if you need to. JSW
 
Upvote 0
And in the style of the above:

=IF(OR(F13="",F16=""),"Add Both Dates Above!",DATEDIF(F13,F16,"y")&" years, "&DATEDIF(F13,F16,"ym")&" months and "&DATEDIF(F13,F16,"md")&" days")

Will give the between age. JSW
 
Upvote 0
What does this tell me?

end date - beginning date +1 divided by 7

What does the one signify???
 
Upvote 0
Hi,

The + 1 means the formula will include the start date as well.

For example, start date = 1/4/02, and end date = 2/4/02. If just use end - start then the answer is 1, but in fact there are 2 dates in between.

That is the reason for + 1.

HTH
 
Upvote 0
Attention Joe Was

Re Datedif You stated "Note: You need the analyze addin that comes with Excel installed to work it. "

Datedif is a regular function; however, it was only documented in Excel 2000
 
Upvote 0
Unlike Datedif, VBA's Datediff has a Week parameter.

With VBA, I created a User Defined Function (UDF) named Weeks . Use it as follows
=Weeks(A4,B4)

The UDF is created in a regular VBA module; you can copy the following into the module.

Function Weeks(dFirstDate, dSecondDate) As Integer
Application.Volatile
Weeks = DateDiff("ww", dFirstDate, dSecondDate)
End Function
This message was edited by Dave Patton on 2002-03-28 11:07
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,952
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top