+ Reply to Thread
Results 1 to 13 of 13

Calculate Months and Return Last Day

  1. #1
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Calculate Months and Return Last Day

    I'm hoping this is going to be an easy one but not sure if it's at all possible.

    In the attached simplified example, I want to enter a date in A2, enter a number of months in B2. For example, in the attached it shows 14 Apr 14 and 48 months. 48 months from 14 Apr 14 is 14 Apr 18. However, I need C2 to result in the last day of that month, i.e. 30 Apr 18.

    Any help appreciated. (hope I've explained the above clearly).
    Attached Files Attached Files
    Last edited by xybadog; 05-08-2014 at 11:38 AM.

  2. #2
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Sorry, the above should read "However, I need C2 to result in the last day of that month, i.e. 30 Apr 18" in the last sentence.

    Update: OP now edited
    Last edited by xybadog; 05-08-2014 at 11:39 AM.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculate Months and Return Last Day

    Hi

    Check this.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Calculate Months and Return Last Day

    All you need is =EOMONTH(A2,B2)

  5. #5
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Quote Originally Posted by gak67 View Post
    All you need is =EOMONTH(A2,B2)
    Thanks. This works great but what if I wanted to add one month (so the answer to my example would be 31 May 18)? Can this be done? I've tried =EOMONTH((B2)+1,B4) but this results in 30 Nov 18.

  6. #6
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Calculate Months and Return Last Day

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The syntax for this function is =EOMONTH(Start date, Number of months)

  7. #7
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Quote Originally Posted by gak67 View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The syntax for this function is =EOMONTH(Start date, Number of months)
    Works great. Thanks for your help.

  8. #8
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Could someone please tell me what change I would have to make to =EOMONTH(A2,B2) to add one day?

    So if A2 was 10 Jan 14 and B2 was 48 the answer currently is 10 Jan 18 but I need the result to show the day after this each time.

  9. #9
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Calculate Months and Return Last Day

    Use :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  10. #10
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Quote Originally Posted by Saarang84 View Post
    Use :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That adds a month, but I need to add just one day

  11. #11
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Calculate Months and Return Last Day

    If A1 contains 10-Jan-14 and B1 contains 48, then EOMONTH(A1,B1) will return 31-Jan-18 and this formula will return 1-Feb-18. Is this what you need?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    07-02-2012
    Location
    UK
    MS-Off Ver
    365/2008
    Posts
    152

    Re: Calculate Months and Return Last Day

    Exactly what I need. Thank you.

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Calculate Months and Return Last Day

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 02-20-2014, 05:46 PM
  2. Using index to return data from list for last 12 months or months available
    By welchs101 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2013, 09:44 AM
  3. Calculate age in months
    By darkobird84 in forum Excel General
    Replies: 1
    Last Post: 03-09-2011, 11:34 AM
  4. Calculate Age in Months
    By Tim Hardison in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-09-2009, 07:42 PM
  5. Calculate 6 Months
    By Jason in forum Excel General
    Replies: 5
    Last Post: 08-18-2005, 08:05 PM

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