+ Reply to Thread
Results 1 to 12 of 12

Determine if a month falls between two dates - YEARS OVERLAPPING

  1. #1
    Registered User
    Join Date
    12-05-2014
    Location
    Manchester
    MS-Off Ver
    2007
    Posts
    45

    Determine if a month falls between two dates - YEARS OVERLAPPING

    Hello, I have been tasked with trying to do the following

    Column A - Date
    column B -Date

    A will always be earlier than B but B might go over to the following year i.e. 1.06.2014 - 14.03.2015

    columns C-Z will be labeled months Jan 2014, Feb 2014, March 2014 and so on right up to Dec 2015.

    What I need to do is determine if the date between column A and B includes
    the given month in column C - Z and return a value of X.

    ie...
    A B C D E F
    Jan 14 Feb 14 Mar 14 Apr 14
    1/1/14 3/12/14 X X X blank

    I can then count the X values.

    Thanks.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Hi.

    Perhaps a small example in an actual workbook would help clarify your query.

    Regards
    Click * below if this answer helped

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

  3. #3
    Registered User
    Join Date
    12-05-2014
    Location
    Manchester
    MS-Off Ver
    2007
    Posts
    45

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Example Doc.xlsx

    Hi

    Please see attached.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Thanks.

    I notice that your "dates" in A2:B3 are not actually Excel-recognised dates, but text entries. Is this the case in reality, or did you just concoct these for the sake of this example?

    Regards

  5. #5
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    For C2 cell

    Please Login or Register  to view this content.
    drag right until Z2 cell then pull down.

  6. #6
    Registered User
    Join Date
    12-05-2014
    Location
    Manchester
    MS-Off Ver
    2007
    Posts
    45

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    XOR LX - It was just the case for the example.

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Try the below formula in C2 and copy across
    =IF(AND(EOMONTH(C$1,0)>=SUBSTITUTE($A2,".","/")+0,EOMONTH(C$1,-1)+1<=SUBSTITUTE($B2,".","/")+0),"X","")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    @nflsales Not sure I understand. The OP already confirmed that the dates in those cells are actual Excel-recognised dates in reality, so no need for any string substitutions.

    As such, Ali Kırksekiz's solution seems perfectly adequate to me.

    Regards

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Quote Originally Posted by XOR LX View Post
    @nflsales Not sure I understand. The OP already confirmed that the dates in those cells are actual Excel-recognised dates in reality, so no need for any string substitutions.

    As such, Ali Kırksekiz's solution seems perfectly adequate to me.

    Regards
    XOR LX my system not recognized 1.06.14 and 01.08.14 as dates that's why replied with the above

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Quote Originally Posted by nflsales View Post
    XOR LX my system not recognized 1.06.14 and 01.08.14 as dates that's why replied with the above
    Neither does mine. That's why I asked the OP if those dates were actually in that format in their actual workbook. Have you not read the previous posts in this thread?

    Regards

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Quote Originally Posted by XOR LX View Post
    Neither does mine. That's why I asked the OP if those dates were actually in that format in their actual workbook. Have you not read the previous posts in this thread?

    Regards
    XOR LX - It was just the case for the example. it was the answer given by "eekbubble" in post number 6 - I was not understand really it's meaning

  12. #12
    Registered User
    Join Date
    12-05-2014
    Location
    Manchester
    MS-Off Ver
    2007
    Posts
    45

    Re: Determine if a month falls between two dates - YEARS OVERLAPPING

    Hi all

    Thanks very much for this, it works very well.

    I have an almost identical sheet that I have tried to apply the same formula to but there is a problem in that with this sheet in that not all of the end dates are populated yet (because they are still open). Is there a way of having a cross in the boxes for the month it applies to even if there is no end date yet? The x just goes up to the current month until the end date is populated?

+ 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: 3
    Last Post: 02-05-2014, 11:53 AM
  2. Lookup total per month (overlapping dates)
    By IKZOUHETNIETWETEN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2013, 06:00 AM
  3. Replies: 3
    Last Post: 07-31-2012, 04:44 PM
  4. Replies: 1
    Last Post: 12-17-2009, 03:46 AM
  5. [SOLVED] Determine years betwen 2 dates
    By Darren in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-03-2006, 12:30 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