+ Reply to Thread
Results 1 to 8 of 8

calcualte months worked this tax year.

  1. #1
    Registered User
    Join Date
    05-29-2009
    Location
    Morpeth, Northumberland
    MS-Off Ver
    Excel 2000
    Posts
    1

    calcualte months worked this tax year.

    What I need to do is calculate the number of months worked by a staff member in this tax year if they enter their start date - taking into account that their start date may be in 2001 (or other) - I need to disregard all information before the start of this tax year. Can anyone help please?

  2. #2
    Registered User
    Join Date
    05-21-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2000
    Posts
    4

    Re: calcualte months worked this tax year.

    Hello, maverikk!

    If I understand you correctly, something like this may do it:

    Please Login or Register  to view this content.
    Last edited by VBAwannabe; 05-31-2009 at 01:32 AM. Reason: Forgot to paste IF Statement

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: calcualte months worked this tax year.

    Maybe:
    monthsworked.xls
    Ben Van Johnson

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: calcualte months worked this tax year.

    VBA is unnecessary!

    Plus since is uk Tax year starts 6/4/2009!

    Please Login or Register  to view this content.
    Will give the full months in B4

    Please Login or Register  to view this content.
    will give decimal months


    Its slightly complicated due to the tax year starting 6/4 in the uk, if you want to use a different base date change all the 6's to the day the tax year starts for you!

    Basically the formula decides which is the biggest, start of taxyear or startdate and uses that as a basis to work on

    it then calculates the days since the start of the last month/ days in this month to get the fractional part
    Last edited by squiggler47; 05-31-2009 at 02:02 AM. Reason: oops
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  5. #5
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: calcualte months worked this tax year.

    VBAWannabe

    VBA is a last resort, most users here would rather not use VBA (yes i know this is excel programming,but a lot of new users dont know the difference!)

    Often solutions are asked for in VBA that can be done in formulas, and I have yet to find a VBA UDF that performs as fast as a formula, nomatter how complex the formula is!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: calcualte months worked this tax year.

    Quote Originally Posted by squiggler47 View Post
    ...I have yet to find a VBA UDF that performs as fast as a formula, nomatter how complex the formula is!
    I would certainly advise reading through Charles Williams' discussion on the matter: http://www.decisionmodels.com/calcsecretsj.htm

    At a talk he gave recently in London he made the point that UDFs could on occasion be deemed preferential to Arrays when used en masse and/or when referencing large ranges.

  7. #7
    Registered User
    Join Date
    05-21-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2000
    Posts
    4

    Re: calcualte months worked this tax year.

    Quote Originally Posted by squiggler47 View Post
    VBAWannabe

    VBA is a last resort, most users here would rather not use VBA (yes i know this is excel programming,but a lot of new users dont know the difference!)

    Often solutions are asked for in VBA that can be done in formulas, and I have yet to find a VBA UDF that performs as fast as a formula, nomatter how complex the formula is!
    Point taken, Squiggler, but as the OP didn't specify and this is Excel Programming, I tried to provide a VBA solution. Now, the OP has options. As far as VBA being a last resort, that is a matter of preference, I think. Cheers!

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: calcualte months worked this tax year.

    Quote Originally Posted by maverikk View Post
    What I need to do is calculate the number of months worked by a staff member in this tax year if they enter their start date - taking into account that their start date may be in 2001 (or other) - I need to disregard all information before the start of this tax year. Can anyone help please?
    If you want a formula solution then you can approach it this way

    To get previous 6th April from today

    =DATE(YEAR(TODAY()+270)-1,4,6)

    So to calculate whole months from that date (or later employee start date) until today

    =DATEDIF(MAX(A1,DATE(YEAR(TODAY()+270)-1,4,6)),TODAY(),"m")

    ...or do you need a result which rounds to the nearest whole month......or takes partial months into account? Some examples always help, I find.....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1