+ Reply to Thread
Results 1 to 6 of 6

How to auto-populate a list based on a date range

  1. #1
    Registered User
    Join Date
    12-18-2018
    Location
    Stoke-on-Trent
    MS-Off Ver
    2010
    Posts
    3

    How to auto-populate a list based on a date range

    Hi

    I'm trying to auto-populate a list of bank holidays that fall within a period. On one worksheet, I have a list of all UK bank holidays from 2016 to 2021. On another worksheet I have a date range that is variable.

    I want to auto-populate a list on the second worksheet to show all the bank holidays that fall within that date range. I've tried using an array formula with index, but have been unsuccessful! Does anybody have any ideas?

    Thanks in advance

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: How to auto-populate a list based on a date range

    It would help if you attached a sample Excel workbook, so we can see how your data is laid out.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post. Don't try to use the Paperclip icon, as it doesn't work on this forum.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-18-2018
    Location
    Stoke-on-Trent
    MS-Off Ver
    2010
    Posts
    3

    Re: How to auto-populate a list based on a date range

    Thanks, Pete

    I have now attached my workbook so hopefully my query makes more sense! I ideally want to auto-populate the data in columns B,C and D of the 'bank holidays' worksheet into columns B,C and D of the 'calculator' worksheet (highlighted by coloured cells on the sheet itself).

    The data to pull through would be the bank holidays that fall within the date range identified in cells C4 and C5. There will only ever be a maximum of 10 lines of data to pull through, as there is only ever a maximum of 10 UK bank holidays in any financial year.

    Thanks again for your reply.

    Gemma

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: How to auto-populate a list based on a date range

    Put this formula in cell E4 of the Bank Holidays sheet:

    =IF(AND(B4>=Calculator!$C$4,B4<=Calculator!$C$5),MAX(E$3:E3)+1,"")

    then copy down to the bottom of your list.

    Then you can use this formula in cell B21 of the Calculator sheet:

    =IFERROR(INDEX('Bank Holidays'!B:B,MATCH(ROWS($1:1),'Bank Holidays'!$E:$E,0)),"")

    Copy the formula into C21 and D21. You will need to format B21 as a date in the style you prefer, then copy the 3 formulae down as far as you like.

    Incidentally, you can simplify the formula in C3 of the Calculator sheet to this:

    =YEAR(C4)&"/"&YEAR(C4)+1

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    12-18-2018
    Location
    Stoke-on-Trent
    MS-Off Ver
    2010
    Posts
    3

    Re: How to auto-populate a list based on a date range

    This works wonderfully, Pete! Thanks so much for your help

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: How to auto-populate a list based on a date range

    Glad it worked for you.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Auto-populate on one tab based on a list and value from another
    By thedunna in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-10-2018, 08:38 PM
  2. Auto populate dates based on date range
    By tmva in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-04-2018, 10:15 AM
  3. Replies: 1
    Last Post: 11-27-2017, 08:50 PM
  4. Auto-Populate date range in grade book sheets based from sheet 1 link
    By Marksman62 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-17-2016, 10:28 PM
  5. [SOLVED] Auto Populate a Linear Calendar Based On A List With Date Ranges
    By falafelologist in forum Excel General
    Replies: 3
    Last Post: 05-20-2015, 08:15 PM
  6. Replies: 1
    Last Post: 05-26-2014, 03:46 AM
  7. Replies: 3
    Last Post: 02-28-2012, 11:54 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