+ Reply to Thread
Results 1 to 3 of 3

Calculate months withing 1st and 2nd half of the year depeding on changable date

  1. #1
    Registered User
    Join Date
    11-23-2017
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    51

    Calculate months withing 1st and 2nd half of the year depeding on changable date

    Hi all,

    I am trying to calculate the months within first and second half per year depending on selected dates. So the user should be able to change the dates as desired, and per year I need to know how many months fall in 1st half and how many in the 2nd half of each selected year. The maximum duration the user can select is 6 years. If the user selects less it should of course return 0.

    Attached is my example file.

    I have the feeling I am thinking too complicated here.

    Thanks a lot for your help.
    Last edited by JasXel; 05-31-2020 at 07:06 AM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate months withing 1st and 2nd half of the year depeding on changable date

    Please try at F2:K3

    =IFERROR(DATEDIF(MAX(DATE(F$1,ROWS(F$2:F2)*6-5,1),EOMONTH($A$2,-1)),MIN(DATE(F$1,ROWS(F$2:F2)*6+1,1),EOMONTH($B$2,0)+1),"M"),0)

  3. #3
    Registered User
    Join Date
    11-23-2017
    Location
    Germany
    MS-Off Ver
    2019
    Posts
    51

    Re: Calculate months withing 1st and 2nd half of the year depeding on changable date

    Quote Originally Posted by Bo_Ry View Post
    Please try at F2:K3

    =IFERROR(DATEDIF(MAX(DATE(F$1,ROWS(F$2:F2)*6-5,1),EOMONTH($A$2,-1)),MIN(DATE(F$1,ROWS(F$2:F2)*6+1,1),EOMONTH($B$2,0)+1),"M"),0)
    Excellent! Thanks a lot!

+ 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. Calculate Date from Year. Months and Days (Forward and Backward both)
    By Premmadaan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2017, 05:45 AM
  2. Calculate Number of weeks/months falls under each year between date range
    By dhitpit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2017, 10:06 AM
  3. [SOLVED] Calculate age between date/year and now to include months ie. 2.3 years
    By micko_escalade in forum Excel General
    Replies: 10
    Last Post: 04-18-2016, 06:34 PM
  4. How to calculate number of months by date range for a specific year?
    By redstyles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-20-2015, 05:53 PM
  5. Calculate remaining complete months in a financial year after a date
    By RichardBl in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-28-2014, 10:14 AM
  6. Need to convert a date to half year convention then count the months...
    By Milkie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-14-2013, 06:05 PM
  7. Replies: 5
    Last Post: 06-07-2008, 02:32 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