+ Reply to Thread
Results 1 to 14 of 14

compare dates and match months intervals

  1. #1
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Question compare dates and match months intervals

    Hey,
    I have a lot of data sets with dates, they need to be matched so spot overlap. I need to know if the dates are within the same months intervals.
    See attachment for example data
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    So what would your expected results be? How awould they be arranged? Please populate your results with some manually calculated results as it is not clear what you want and where you want it...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    ok trying again. New file.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    God, but I haven't a clue what you want.

    Are the 10 dates in each table 10 individual dates or 5 pairs of dates?

    Why does cell S5 contain a "1" when NONE of the dates in data 2 are within (at least) a month of May 2016?

    I don't do guessing games. One last chance... Please explain how you derive these results.

  5. #5
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    Quote Originally Posted by Glenn Kennedy View Post
    God, but I haven't a clue what you want.

    Are the 10 dates in each table 10 individual dates or 5 pairs of dates?

    Why does cell S5 contain a "1" when NONE of the dates in data 2 are within (at least) a month of May 2016?

    I don't do guessing games. One last chance... Please explain how you derive these results.
    The range 25.05.2016-06.06.2016 (from C3 and D3) has 25,26,27,28,29,30,31 within the 5th month (may). So i just put 1 to show that minimum 1 of the days in the range is in that month.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    OK. Got it. I understand now...

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    Try this in O5, copied across:
    =SUMPRODUCT(($C$3:$C$7<=DATE($N$4,MONTH(1&O$4)+1,1))*($D$3:$D$7>=DATE($N$4,MONTH(1&O$4),1)))

    and this in O6, copied across:
    =SUMPRODUCT(($C$3:$C$7<=DATE($N$4,MONTH(1&O$4)+1,1))*($D$3:$D$7>=DATE($N$4,MONTH(1&O$4),1)))

    returns the number of overlaps. If you want some other sort of value returned, it should be easy...
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 09-15-2017 at 02:00 PM.

  8. #8
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    Thanks very much is there a way to only put 1 if as the value even if the periods overlap?

  9. #9
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    From this i can with my minimum skills in excel find out and calculate that dataset 1 and dataset 2 months dont match 100 %. But are there a way to check how many months of dataset 2 that dont match with dataset 1 months?

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    Does this answer your Q at Post 8?

    I don't quite understand what you want at Post 9.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    Thanks very much Glenn Kennedy.
    Nevermind the other question this was very helpful!

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    Aguess for your Q at post 9...
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    07-16-2017
    Location
    norway
    MS-Off Ver
    365
    Posts
    46

    Re: compare dates and match months intervals

    Quote Originally Posted by Glenn Kennedy View Post
    Aguess for your Q at post 9...

    Perfect! thanks! :D

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: compare dates and match months intervals

    Woo Hoo!!!

    you're welcome.

+ 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. [SOLVED] Conditional Format - Dates greater than 18 months and 24 months
    By amandavan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-03-2024, 04:08 PM
  2. How to compare database with a set group of intervals
    By FernTurpin in forum Excel General
    Replies: 3
    Last Post: 06-19-2015, 04:47 PM
  3. Replies: 8
    Last Post: 02-20-2014, 05:46 PM
  4. Compare 2 rows and (if they match), provide difference between 2 dates
    By PastramiDave in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2012, 02:43 PM
  5. Calculate Rolling Sum for Last 12 Months - Variable Entry Intervals
    By jancer in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-10-2012, 03:51 PM
  6. [SOLVED] Charting data against dates where dates are not at fixed intervals
    By PK in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-16-2005, 01:05 AM

Tags for this Thread

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