Consulting

Results 1 to 4 of 4

Thread: Getting Month and Year from a date cell

  1. #1
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    228
    Location

    Question Getting Month and Year from a date cell

    Hi There,

    Can anyone help with the following please.

    I have 2 columns containing dates - Start Date and End Date - I need to add a further 3 columns - Start Month, End Month and Hours

    I can not work out the correct formula to use to extract the month and year info from the original cell and format it as mmm - yyyy

    I also need to calculate the nu7mber of weeks between start and end date * 37.5 to give me hours.

    I have attached an example sheet for reference.

    Thanks in advance.

    Marshybid

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could just put =A" and format as mmmm yyyy, or else use

    =TEXT(A2,"mmmm yyyy")
    =TEXT(B2,"mmmm yyyy")

    Do you want whole weeks? If so, rounded up or down, when does a week start? If not

    =(B2-A2)/7*37.5
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    228
    Location
    Thanks xld. I can't believe I hadn't even considered using the Text formula I was trying Month/Year etc formulas. DOH!!!!

    Do you want whole weeks? If so, rounded up or down, when does a week start? If not

    =(B2-A2)/7*37.5
    I would ideally like to calculate total accurate number of working days (5 days per week) between start and end date * 7.5 per day to give me my hours (I don't know if NETWORKDAYS would do it)??

    Marshybid

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That would just be

    =NETWORKDAYS(A2,B2)*7.5
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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