Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calc Number of Months PER YEAR Between Dates
Hi:
I have two dates: 2/3/2005 6/8/2007 I need to calculate the number of months PER YEAR between the dates. For example: YEAR # MONTHS/YR 2005 12 2006 12 2007 6 This can be VBA, a recorded macro, or a calc. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calc Number of Months PER YEAR Between Dates
On Jul 11, 5:34*pm, amywolfie wrote:
Hi: I have two dates: 2/3/2005 6/8/2007 I need to calculate the number of months PER YEAR between the dates. For example: YEAR * *# MONTHS/YR 2005 * * 12 2006 * * 12 2007 * * *6 This can be VBA, a recorded macro, or a calc. *Thanks! This UDF (placed in a REGULAR module) and then, on the sheet, type =monthsinyear(a1,a2,2005) or if b1 has 2005 =monthsinyear(a1,a2,b1) to get 2005 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calc Number of Months PER YEAR Between Dates
Thanks Don.
I have never written VBA code for Excel, only Access. How do you define a REGULAR module? Do you create a Public Function monthsinyear () where Dim monthsinyear As Integer Is there anything else that has to be coded in VBA? Thanks! ==== |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number of Months Between Two Dates Entered | Excel Discussion (Misc queries) | |||
Calc days between two dates and exclude leap year days | Excel Worksheet Functions | |||
Dates: How to check if date value is 10 months and or 1 year old? | Excel Programming | |||
Number of months between 2 dates | New Users to Excel | |||
count number of months year to date | Excel Worksheet Functions |