+ Reply to Thread
Results 1 to 11 of 11

Pull through selective dates only based on various criteria

  1. #1
    Registered User
    Join Date
    04-25-2008
    Location
    Essex, England
    MS-Off Ver
    Office 2010
    Posts
    52

    Pull through selective dates only based on various criteria

    Hi,

    I attach an example of what I am trying to do. Have already had some help on this but every time I crack it, another variable seems to get added in!

    On the sheet 'Split Year Leave' in L9 downwards, I want to pull in the relevant Bank Holiday dates for the period based on the dates set in C9 and C10. I have already done this but the issue is that some of the dates required don't fall exactly between these dates. For calculation purposes, there is always 8 in one financial year and so some get moved to the one before or after to balance them out. On sheet 'Data' in E2 I have set out in columns exactly what dates fall in what period so this can be seen.

    I have added some dates in the sheet to populate it and you will see I need it to also show the BH on the 30/3/18.

    On another sheet 'Full year leave' i just reference the column required in B12 as that will only ever show 8. This sheet therefore works perfectly for what I need.

    I am guessing I need a formula to go in L9 that is a mixture of the one currently in it and also the one currently in 'Full year leave' B12 to ensure that the right data gets pulled through.

    I hope I have explained that properly....Can anyone help please?

    Thanks, Crackerdaq
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Pull through selective dates only based on various criteria

    ... If I understand the check will be:

    If any BH between the Dates specified falls on a Monday, check if previous Friday is BH OR if BH falls on a Friday, check if following Monday is a BH: I either are TRUE, add to list ????

  3. #3
    Registered User
    Join Date
    04-25-2008
    Location
    Essex, England
    MS-Off Ver
    Office 2010
    Posts
    52

    Re: Pull through selective dates only based on various criteria

    Hi,

    Thanks for reply. I think so but not sure that would only limit to 8 over the years.

    I would think the easiest check would be to display the range of BH based on the entry in C11 and then only show the dates that fall between the range in C9:C10. This pulls in from the corresponding columns in the 'data' tab.

    Thanks

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Pull through selective dates only based on various criteria

    WD by Ankur
    Last edited by shukla.ankur281190; 01-15-2018 at 05:10 AM.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Pull through selective dates only based on various criteria

    That would not work as it would not select 30/08/2018 which what I Understood you wanted for dates currently shown C9:C10

    you will see I need it to also show the BH on the 30/3/18

  6. #6
    Registered User
    Join Date
    04-25-2008
    Location
    Essex, England
    MS-Off Ver
    Office 2010
    Posts
    52

    Re: Pull through selective dates only based on various criteria

    Good point....you're right it wouldn't work.

    Looking at your check, it wouldn't work in 2024/2025 as would pull through 29/3/24. Similar for the years onwards.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Pull through selective dates only based on various criteria

    The logic needs to test if the Friday situation exists in the selected year: as the Monday is the first date in 24/25 the previous Friday (in previous year) would (have to) be ignored.

  8. #8
    Registered User
    Join Date
    04-25-2008
    Location
    Essex, England
    MS-Off Ver
    Office 2010
    Posts
    52

    Re: Pull through selective dates only based on various criteria

    Ok that makes sense. How though?

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Pull through selective dates only based on various criteria

    The "easiest" way I can think of is to check the date in C9 against the appropriate year i.e tables in E onward: if it (C9) is a Monday, check if date C9-3 [a Friday] in the table, then change C9 to this date.

    However to do this will require VBA.
    Last edited by JohnTopley; 01-15-2018 at 07:28 AM.

  10. #10
    Registered User
    Join Date
    04-25-2008
    Location
    Essex, England
    MS-Off Ver
    Office 2010
    Posts
    52

    Re: Pull through selective dates only based on various criteria

    Not easy then - especially for me as have no idea on VBA (was at the limit of my knowledge with a lot of the above!)

    Having looked at it, a workaround for 2018/19 is to use 30/3/18 as a start date in C9 as all the other calculations will work. The issue comes in 2024/25 but perhaps by that time I will either have learnt VBA or more likely I can get someone else to do it!

    Thanks for your help though.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Pull through selective dates only based on various criteria

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] Selective summation based on criteria?
    By Fizziii in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-05-2017, 02:13 PM
  2. [SOLVED] Pull selective codes macro
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-01-2016, 01:15 AM
  3. Copy data from one sheet to another based on selective criteria
    By jnmturner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2013, 05:30 AM
  4. Pull Data Based On Dates
    By KCKuhns92 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-29-2013, 12:43 PM
  5. Replies: 6
    Last Post: 06-27-2013, 08:49 AM
  6. Macro to Pull Selective Data
    By Swordfish1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2012, 08:37 PM
  7. Selective pull down menu
    By Kalberts in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2011, 05:49 AM

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