+ Reply to Thread
Results 1 to 13 of 13

Weekly Filter

  1. #1
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Weekly Filter

    Hi Guys,

    I'm trying to filter data from the all day sheet into the Area Performance sheet. It would be great to show a all month and for each week. Somehow I can't figure out how to filter for dates in this particular case. Also the On Time%, Late 30min should be weighted calculations. I tried many things but the results never matched.

    Also is there any way to do a conditional formatting to include or exclude a row based on a value in a different column?
    For Example
    in Area Performance column E (% Dispatched) the % must be above 10% and if so highlight the highest on time % in column C On Time %. If it's less than 10% in column e it should not highlight it in column C even though it would be the highest.

    Every help is appreciated.
    Thanks,
    Maritn
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Weekly Filter

    Hi
    I suppose you can use pivot tables

    You can orgabnize data on 'All Day' sheet in a table(Date,Orders,On Time,L-30M,Week#,Zone)

    See the file
    Attached Files Attached Files

  3. #3
    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,150

    Re: Weekly Filter

    Non-Pivot table:

    in B3


    =INDEX('All Day'!$B$4:$X$4,,MATCH($A3,'All Day'!$B$2:$X$2,0))

    in C3

    =INDEX('All Day'!$B$4:$X$4,,MATCH($A3,'All Day'!$B$2:$X$2,0)+1)

    in d3

    =INDEX('All Day'!$B$4:$X$4,,MATCH($A3,'All Day'!$B$2:$X$2,0)+2)

    in B15

    =SUMIFS(INDEX('All Day'!$B$6:$X$35,,MATCH($A15,'All Day'!$B$2:$X$2,0)),'All Day'!$A$6:$A$35,">="&$B$13,'All Day'!$A$6:$A$35,"<="&$D$13)

    in C15

    =AVERAGEIFS(INDEX('All Day'!$B$6:$X$35,,MATCH($A15,'All Day'!$B$2:$X$2,0)+1),'All Day'!$A$6:$A$35,">="&$B$13,'All Day'!$A$6:$A$35,"<="&$D$13)

    in D15

    =AVERAGEIFS(INDEX('All Day'!$B$6:$X$35,,MATCH($A15,'All Day'!$B$2:$X$2,0)+2),'All Day'!$A$6:$A$35,">="&$B$13,'All Day'!$A$6:$A$35,"<="&$D$13)


    in All cases, copy down to last area

    I added 2 lines to "All Data" to get monthly totals for % calculation.

    A similar calculation for Weekreports is rather trickier as you cannot simply average the AVERAGES as the number of entries per area varies.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Weekly Filter

    Thanks for the fast reply, and the great awesome help. I like both ideas but I will go with the no pivot table option. The only thing I noticed in that it doesn't calculate the weighted % .
    Is there any chance we can add that to the formula?
    Thanks,
    Martin

  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,150

    Re: Weekly Filter

    What is "Weighted %" calculation?

  6. #6
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Weekly Filter

    If "weighted %" means the same thing it did in the last workbook I dabbled with for this OP, then he means that the percentages should be weighted based on the number of orders when combined, rather than averaged together. For example, if I have a 50% on time rate over 2 orders one day and a 90% on time rate on 100 orders the next day, then my total on time percentage could be the average of the two days (70%) or it could be the weighted percentage (89% or 91/102). I presume that the OP is looking for the latter. Using JohnTopley's attachment, I think the weighted average for totals can usually be obtained using SUMPRODUCT/SUM, so on 'All Day' in C4, I used:

    =SUMPRODUCT(C6:C35,B6:B35)/B4

    Adjust it for D4, then copy the pair across the row. The same structure can be used on 'Area Performance' in C9:D9, C21:D21, etc. The more substantial change I made was to the weekly area totals. Building off of JohnTopley's work, I tried the following in C15, which should be array-entered (confirmed with Ctrl + Shift + Enter):

    =SUM(IF(($A15='All Day'!$B$2:$X$2)*('All Day'!$A$6:$A$35>=$B$13)*('All Day'!$A$6:$A$35<=$D$13)=1,'All Day'!$B$6:$W$35*IF('All Day'!C$6:Y$35="",0,'All Day'!C$6:Y$35),0))/$B15

    Fill right and down. Modify the date cells for the other even weeks. For the odd weeks, you'll also need to update the $A15 and $B15 references accordingly. I spot checked a few and the numbers seem to hold up, but I'd advise a more thorough check. Presuming that I'm understanding weighted% correctly, hopefully this gets it?
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  7. #7
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Weekly Filter

    @JohnTopley as CAntosh already mentioned Weighted averages are calculated between the % and the value. For example a regualar =average for 100 order 50% and 200 Orders 100% would be 75%, but since we had the double amount of orders 100% it would not be correct therefore you multiple each order with the %, add it together and divide through total orders that gives you the weighted average.

    @CAntosh absolutely nailed it again but one thing I noticed if there is one or more empty rows lets say only data for the half week is on the All Day sheet the on time and late30 only shows #Value! and not the numbers for the half week. Is that a bug? or just the way it is?




    I also kinda understand your formula when I'm looking at it but somehow I can't figure out all of it and it would be great if you could explain it a little more what it stands for or what it does.

    =SUM(IF(($A15='All Day'!$B$2:$X$2)*('All Day'!$A$6:$A$35>=$B$13)*('All Day'!$A$6:$A$35<=$D$13)=1,'All Day'!$B$6:$W$35*IF('All Day'!C$6:Y$35="",0,'All Day'!C$6:Y$35),0))/$B15

    What does the 1 mean? Exact match? $A$35<=$D$13)=1

    IF('All Day'!C$6:Y$35="",0, What exactly does that do

    'All Day'!C$6:Y$35),0)) and this one?



    Also is there any way of conditional formatting where it first looks at area performance D3:D8 if it's lower than 3% and if so highlight the highest number in B4:B8 ( the ones above 3% in D should not count in B)


    Thank you so much guys your help is very very appreciated.
    Martin

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Weekly Filter

    The first IF clause checks our three conditions:

    ($A15='All Day'!$B$2:$X$2)*('All Day'!$A$6:$A$35>=$B$13)*('All Day'!$A$6:$A$35<=$D$13)=1

    Correct area*after start date*before end date = 1. TRUE counts as 1 for each term, FALSE calculates as 0. We multiply the 3 terms so that only the entries for which all three criteria are TRUE return an "=1" value for the entire 3-part IF check. That's why the =1 is at the end of the clause.

    If the IF clause discussed above is true, then we want to return the number of orders for that entry multiplied by the on time %, which will give us total number of on time entries (B6:W35 * C6:Y35). The first IF formula basically breaks down to: IF(all 3 criteria are met, THEN total multiplied by % on time, OTHERWISE zero). This returns an array of the On Time totals for all entries that fit the criteria. We then sum this array to get the on time total for all qualified entries and divide it by the Total (in B15) for the weighted percentage.

    The second IF clause was meant as a workaround to avoid errors when a slot on "All Day" is left blank, like K17:L17. It just replaces blanks with zeroes. Consequently, I don't see any #VALUE errors, so I'm not sure which ones you're referring to. Maybe double check to see if the formula in that cell is array-entered? If that doesn't work, post an attachment that shows the errors.

    Hopefully that helps? Walking through the formula step-by-step with 'Evaluate Formula' on the Formulas tab will also prove instructive.

    I'm not clear on what this means:
    it first looks at area performance D3:D8 if it's lower than 3% and if so highlight the highest number in B4:B8 ( the ones above 3% in D should not count in B)
    It might be instructive to provide a more detailed explanation of what should happen. I'm likely offline until Monday, but hopefully JohnTopley and Jose Augusto are still subscribed, or maybe someone else can jump in.

  9. #9
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Weekly Filter

    Thanks for the explaination, I will have to sit down and play around more to make it more understandable for me.


    I attached another file with the value error and with the conditional formatting. I also thought more about the conditional formatting and it should be as following.
    The Highest On Time% with a minimum of 10% dispatched should turn green
    If multiple have the same number the one with the lowest Late30 should turn green.

    I also made a sample at the attached file

    Please let me know if you need more info.

    Thanks for all your help.
    Have a great Thanksgiving weekend
    Martin
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Weekly Filter

    Ah, I get it (I hope). You can protect against VALUE errors for blank rows with another little IF clause to replace "orders" blanks with zeroes the same we fixed "on time %" blanks. C27 could be (array-entered):

    =SUM(IF(($A27='All Day'!$B$2:$X$2)*('All Day'!$A$6:$A$35>=$B$25)*('All Day'!$A$6:$A$35<=$D$25)=1,IF('All Day'!$B$6:$W$35="",0,'All Day'!$B$6:$W$35)*IF('All Day'!C$6:Y$35="",0,'All Day'!C$6:Y$35),0))/$B27

    Fill down and right for that week. Adjust as described earlier for the other weeks.

    If I'm understanding your conditional formatting request correctly, you can highlight the range to be colored (H3:H8 in the sample), select "new rule" and "use a formula", then use the following:

    =$H3+0.00000000001*(1-$I3)=MAX(IF($J$3:$J$8>=0.1,$H$3:$H$8+0.00000000001*(1-$I$3:$I$8),0))

    It should return the highest H value among those with J values of 10% or higher, using lowest I value as a tie-breaker. In this case, it returns H4 (South) at 86%. In your attachment, you highlighted H6, which is also 86% and has a lower late%, but H4 is actually 86.18%, whereas H6 is 86.00%. If you prefer to round the H values before calculating, wrap each of the H terms in the formula in a ROUND, ROUNDDOWN, etc. function as desired.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Weekly Filter

    Thanks for fixing the Value thing, it works perfect.

    I tried to add a Round formula to to the ON time formula in column a but it always turns out to show me 100%
    Last edited by fotodude; 11-23-2017 at 02:53 PM.

  12. #12
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Weekly Filter

    If you're still trying to implement the ROUND functionality, you can include it in the conditional formatting formula:

    =ROUND($H3,2)+0.00000000001*(1-$I3)=MAX(IF($J$3:$J$8>=0.1,ROUND($H$3:$H$8,2)+0.00000000001*(1-$I$3:$I$8),0))

    OR

    You can wrap the formula in H in ROUND. In H3 and filled down, try:

    =ROUND(INDEX('All Day'!$B$4:$X$4,,MATCH($A3,'All Day'!$B$2:$X$2,0)+1),2)

  13. #13
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Weekly Filter

    Somehow I just saw your reply now. Thanks a lot it works perfect.

    Happy Holidays,
    Martin

+ 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] Weekly sales tracker - weekly average sales amount
    By rossw8 in forum Excel General
    Replies: 2
    Last Post: 09-01-2015, 08:02 AM
  2. [SOLVED] Converting daily data into weekly and making the weekly number a cumulative return
    By Duchess1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-28-2015, 10:23 AM
  3. Need to filter a report filter based on the previous filter
    By elliotencore in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-28-2014, 07:44 AM
  4. Copy Data from Multiple weekly Sheet to Monthly sheet and filter the data
    By santhoshjoseph in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-06-2012, 07:07 AM
  5. Replies: 10
    Last Post: 05-11-2012, 02:14 AM
  6. Weekly sum
    By martynbailey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2011, 05:06 PM
  7. Sum by Weekly
    By hardeep.kanwar in forum Excel General
    Replies: 2
    Last Post: 04-03-2011, 03:24 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