+ Reply to Thread
Results 1 to 7 of 7

Advanced filter - return last business day of each week - holidays accounted

  1. #1
    Registered User
    Join Date
    07-31-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    6

    Advanced filter - return last business day of each week - holidays accounted

    Hello,

    I would like to filter raw data so that it returns the last business day of each week with holidays accounted. Below is the data set:

    2015-01-06 Tue
    2015-01-05 Mon
    2015-01-02 Fri
    2014-12-31 Wed
    2014-12-30 Tue
    2014-12-29 Mon
    2014-12-24 Wed
    2014-12-23 Tue
    2014-12-22 Mon
    2014-12-19 Fri
    2014-12-18 Thu
    2014-12-17 Wed

    The criteria I've applied to the advanced filter is '=AND(WEEKDAY(E2,2)<6,WEEKNUM(WORKDAY(E2,1,Holidays!$C$2:$C$147))<>WEEKNUM(E2))'. Holidays included 25 and 26 Dec 14.

    The result is:
    Fri 02 Jan 15
    Wed 31 Dec 14
    Fri 19 Dec 14

    The required result is:
    2015-01-02 Fri
    2014-12-24 Wed
    2014-12-19 Fri

    Please let me know if I've made an error or if there are alternate ways for me to obtain the correct result. Thanks for your help in advance.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Advanced filter - return last business day of each week - holidays accounted

    Result and your requirement looks to be same?

    It's just formatting difference it looks like. If that isn't the case, I'd recommend uploading sample workbook that replicates your issue (see yellow banner at the top).
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    07-31-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    6

    Re: Advanced filter - return last business day of each week - holidays accounted

    Please find attached my spreadsheet.

    The required result is:
    2015-01-02 Fri
    2014-12-24 Wed
    2014-12-19 Fri

    The extra record from the advanced filter that I'm trying to remove is 31 Dec 14.

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

    Re: Advanced filter - return last business day of each week - holidays accounted

    Please try at G3
    =IFERROR(INDEX($A$1:$A$13,AGGREGATE(15,6,ROW($A$2:$A$13)/($A$2:$A$13=WORKDAY($A$2:$A$13+7-WEEKDAY($A$2:$A$13),-1,$C$2:$C$5)),ROWS(G$3:G3))),"")

  5. #5
    Registered User
    Join Date
    07-31-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    6

    Re: Advanced filter - return last business day of each week - holidays accounted

    That formula worked but it didn't seem to work for a larger data set.

    My apologies not making it clear. I need the filter to return the date (columns A) and associated value (column B).

    Please see attached for the complete data set where I'm trying to return the applicable cells from columns A and B. I've highlighted some of the returns that are incorrect.

  6. #6
    Registered User
    Join Date
    07-31-2020
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    6

    Re: Advanced filter - return last business day of each week - holidays accounted

    Please ignore my last email as I've solved my query. Instead of using '<>' in the second logical requirement, I've used '>'.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,929

    Re: Advanced filter - return last business day of each week - holidays accounted

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


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Advanced Filter Criteria to Return Cell Below...
    By Ourkid123uk in forum Excel General
    Replies: 4
    Last Post: 05-16-2017, 01:44 PM
  2. Calculation of business hours exculding sundays and holidays
    By balundl in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-30-2014, 01:17 PM
  3. advanced filter - button to re apply advanced filter across multiple sheets
    By motmac87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2013, 11:16 PM
  4. [SOLVED] Return Names From List w/o Advanced Filter or Pivot Table?
    By d_striker in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 12-28-2012, 08:02 PM
  5. Return Unique Text Values without Advanced Filter
    By nicknick5219 in forum Excel General
    Replies: 11
    Last Post: 05-21-2009, 10:15 AM
  6. Advanced Filter to return Rows w/blank column
    By ChemistB in forum Excel General
    Replies: 3
    Last Post: 04-01-2009, 01:14 PM
  7. Business Days Including Holidays
    By Dmorri254 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-03-2006, 07:55 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