+ Reply to Thread
Results 1 to 27 of 27

Determine LARGE with most recent data point excluded

Hybrid View

  1. #1
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Determine LARGE with most recent data point excluded

    Hello All,

    First post here but have been a long-time lurker. I have an interesting Excel issue that has me stumped and I'm hoping you fine folks might be able to come up with a solution. I will throw down the gauntlet and say that I'm very proficient at Excel and typically am offering help to others but this one has me scratching my head. If you can solve this, you are definitely a worthy Excel user!!!

    Here is my data as laid out in the spreadsheet

    Col_A_____Col_B______Col_C_______Col_D_______Col_E______Col_F
    Most Recent Event Date: 06/01/10
    01/1/10____02/1/10____03/1/10______04/1/10_____05/01/10____06/01/10
    355_______420________405_________257_________330________415

    I am using the following formula to summate the top 4 of 6 available values currently:
    =SUM(LARGE(($A2,$B2,$C2,$D2,$E2,$F2),{1,2,3,4}))

    What I need to do is find the sum of the largest 4 values and exclude the value that matches the "Most Recent Event Date" of 06/01/10. The Most Recent Event Date will of course change as new data events are added with new dates, so if a match occurs between the Most Recent Event Date and the column Event Date, then that data entry should not be included in the LARGE function.

    My use for the spreadsheet is to enter monthly data after is occurs (think sports scoring), and want to determine the total score amongst all participants prior to the last sporting event (thus the reason for excluding the last Event Date). This will allow me to calculate a historical ranking and then compare the historical rank to the most recent rank to see which competitors increased or decreased in rank after the newest scores are posted.

    I told you this was a doozy. I would appreciate any help you folks can provide. Feel free to reply with any questions and I would be happy to further clarify and troubleshoot.
    Last edited by mattmcg; 09-09-2010 at 03:14 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    Is that meant to be C8 or should it be A2?

    If one of the dates matches then do you exclude that column's value and then still take the largest 4 from the remaining 5?
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Quote Originally Posted by daddylonglegs View Post
    If one of the dates matches then do you exclude that column's value and then still take the largest 4 from the remaining 5?
    Yes, exactly. So if the "Most Recent Event Date" matches the date in the column (i.e. Event Date), then that value should be excluded and the LARGE function should select the highest 4 of 5 remaining data points.

  4. #4
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Good eye. Yes, that was an error on my part. It is actually $A2 and corresponds to the first data entry value 355.

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    Yes, exactly. So if the "Most Recent Event Date" matches the date in the column (i.e. Event Date), then that value should be excluded and the LARGE function should select the highest 4 of 5 remaining data points.
    This implies you will only ever have 6 columns of data. If this is the case (which I doubt) wouldn't you just use LARGE as you have on the first 5 columns of data (assuming your event dates are in chronological order)?

  6. #6
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Yes, in the example, I will only have 6 total entries at any given time. Since we are collecting scores, think of a competitive season having 6 matches where we start with Jan, then Feb, and so on.

    When we start the year at the first month, the spreadsheet score entries are:
    Col_A_____Col_B______Col_C_______Col_D_______Col_E______Col_F
    Most Recent Event Date: 01/01/10
    01/1/10____02/1/10____03/1/10______04/1/10_____05/01/10____06/01/10
    355_______0_________0____________0_________0___________0

    As we get to the 5th month, the spreadsheet score entries are:
    Col_A_____Col_B______Col_C_______Col_D_______Col_E______Col_F
    Most Recent Event Date: 05/01/10
    01/1/10____02/1/10____03/1/10______04/1/10_____05/01/10____06/01/10
    355_______420________405_________257_________330________0

    Thus we are looking to calculate the top 4 scores excluding the 05/01/10 entry at month 5.

    As we get to the 6th month, the spreadsheet score entries are:
    Col_A_____Col_B______Col_C_______Col_D_______Col_E______Col_F
    Most Recent Event Date: 06/01/10
    01/1/10____02/1/10____03/1/10______04/1/10_____05/01/10____06/01/10
    355_______420________405_________257_________330________415

    Once the 6th match event occurs, we are needing the same top 4 scores but excluding the 6th data entry.

    This allows me to look at the ranking before the last match (which is what I can't calculate) with the current ranking (which I am already calculating).

    Make sense?

  7. #7
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    Given the events are in chronological order. Does this work for you:

    Dates in row 2 & Values In row 3

    EDIT:

    Correction:
    =IF(COUNT(A3:IV3)<5;SUM(A3:IV3);SUM(LARGE(A3:INDEX(A3:IV3;0;MATCH(MAX(A2:IV2);A2:IV2;0)-1);{1;2;3;4})))

    In case you have more than 6 columns of data will look at the highest 4 scores from the previous period back.
    Last edited by pb71; 09-09-2010 at 04:39 PM.

  8. #8
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    That is getting very close. I've tested that within my sheet and it gets close but I have a few more equation constraints that cause it not to work.

    I've put together a sample test sheet here with a data layout that is close to what I'm using in my original model. The highlighted portion is the formula that I need. The other data is laid out and has constraints similar to my original spreadsheet (which is massive and has some sensitive data so don't want to simply attach it).

    And for reference (since I know this will come up), in the actual sheet I am looking for the Top 8 of 12 entries (we have an event each month). Sorry to confuse that, I was trying to simplify the problem earlier but it didn't provide the best info in retrospect.

    I've also scanned this to ensure that it is virus-free, so no issues. I greatly appreciate your help!
    Attached Files Attached Files
    Last edited by mattmcg; 09-09-2010 at 09:07 PM.

  9. #9
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    Please see attached. You would make it a lot easier for yourself without the spaces between the data columns.
    Attached Files Attached Files
    Last edited by pb71; 09-10-2010 at 09:05 AM.

  10. #10
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Thanks pb71. I see though that you've used ranges rather than specific cell references. Is there any way to have it be cell references instead? I've tried it separating the cell references with commas but that doesn't work with the functions listed. Unfortunately the ranges pick up other numbers listed in my master sheet and it breaks.....

    I'll send you a PM directly with a bit more info.

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    pb71's suggested formula seems to work even if you have data in the intermediate cells like F3 and H3. It fails if Event count is 8 or less....but you could fix that with a small tweak like this

    =IF(D3-1<8,SUM(IF(MOD(COLUMN(E3:Q3),2),E3:Q3)),SUM(LARGE(IF(ISNUMBER(E3:AA3)*MOD(COLUMN(E3:AA3),2)*($E$2:$AA$2<$A$1),E3:AA3),{1,2,3,4,5,6,7,8})))

    Personally I think you could avoid the MOD(COLUMN usage if you can differentiate between column headers, e.g. as long as row 2 will have numbers (dates) in the relevant columns only then you could simplify to

    =SUM(IF(D3-1<8,IF(ISNUMBER(E$2:AA$2),E3:AA3),LARGE(IF(ISNUMBER(E$2:AA$2)*(E$2:AA$2<$A$1),E3:AA3), {1,2,3,4,5,6,7,8})))

    confirmed with CTRL+SHIFT+ENTER

  12. #12
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    Thanks daddylonglegs, I obviously didn't test it properly.

    @mattmcg:
    Please could you post a dummy workbook that represents your actual data/layout in the thread.

  13. #13
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    pb71 and daddylonglegs, I've PM'd each of you with a link to the actual spreadsheet I'm using. Take a look as it will identify some of the additional contraints that I'm referring too.

  14. #14
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    Hi mattmcg,

    For the benefit of other members, who may have their own suggestions to add, please could you post a dummy workbook in the thread. You mention that the formulae pick up other numbers in your spreadsheet? Could you not represent these constraints in a dummy workbook?

    On a side note, please could someone test the formulae below in the attached workbook using Excel 2003. I may be imagining things but I'm pretty sure I had to use ISNUMBER in Excel 2003 to avoid errors if there was text interspersed between the date columns.

    I have Excel 2007 at home and ISNUMBER is redundant in the formula.

    B3: =SUM(IF(D3-1<8,IF(MOD(COLUMN(E3:Q3),2),E3:Q3),LARGE(IF(MOD(COLUMN(E3:AA3),2)*($E$2:$AA$2<$A$1),E3:AA3),{1,2,3,4,5,6,7,8})))

    B4: =SUM(IF(D4-1<8,IF(ISNUMBER(E4:Q4)*MOD(COLUMN(E4:Q4),2),E4:Q4),LARGE(IF(ISNUMBER(E4:AA4)*MOD(COLUMN(E4:AA4),2)*($E$2:$AA$2<$A$1),E4:AA4),{1,2,3,4,5,6,7,8})))

    @mattmcg:
    In hindsight, as it is "Prior Best 8", would you want a null value if you didn't have at least 8 records?

    B5: =IF(D5-1<8,"",SUM(LARGE(IF(MOD(COLUMN(E5:AA5),2)*($E$2:$AA$2<$A$1),E5:AA5),{1,2,3,4,5,6,7,8})))

    Have you considered the suggestion from daddylonglegs?
    Attached Files Attached Files

  15. #15
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    Hello Matt,

    I agree with pb71, I had trouble opening your sheet, best to post a version on here. I'm not sure what the issue is, pb71's suggestion will ignore the intermediate columns.......is it that they aren't every other column....are they evenly spaced?

    pb71,

    Don't believe you need ISNUMBER in any version [of excel], shorter version works fine....

    regards, daddylonglegs

  16. #16
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    Hello Matt,

    I think you can use the method I proposed previously, with a small tweak. The columns you want to consider all have "Combined" in row 6 so you can use this formula in B7

    =SUM(LARGE(IF((V$6:CJ$6="Combined")*(T$5:CH$5<$A$3),V7:CJ7,0),{1,2,3,4,5,6,7,8}))

    confirmed with CTRL+SHIFT+ENTER and copied down.....and given that non-qualifying columns show zero you don't need to make any special provision for less than 8 values - that will be accommodated automatically

  17. #17
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    @daddylonglegs:
    Thanks for the feedback. So I must have been imagining it. I really am not having a good day.

  18. #18
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Ok, not a problem. I'm using Excel 2010 so the file is saved as an .xlsx format which is probably the issue. I'll save it as an .xls for you all.

    Attached is the original sheet with all the sensitive stuff removed. I've highlighted the data relevant to the formula in red. I also highlighted the "Prior Top 8 Score" which is where the formula result will reside.

    @pb71, regarding the <8 results, if a competitor has less than 8 results, they will simply be summed and entered except for the most recent match. I was planning on an IF statement to have the simple summation sans last match result if TRUE, the complex summation of the top 8 minus last event results if FALSE.

    To keep the formula objective in perspective, my output is simply to remove the last score as of the last event date (the one that matches the date entered in the "Last Data Update" pulldown). If the date there matches the event date, then that month's points should be removed. This result sans the last months points, will then be ranked and used to calculate the difference between the current rank and the old rank.

    Being able to see how competitors move up and down the ranks each month is what we're trying to do!
    Attached Files Attached Files
    Last edited by mattmcg; 09-10-2010 at 07:21 PM.

  19. #19
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Daddylonglegs@ I believe that did it! I have updated my sheet and everything seems to be working well! I'll test it over the next few days to see if I can trip it up at all but the logic in the formula seems sound and frankly simplified given the "combined treatment".

    So I hate to ask it but do you think there is a way to also tie the "Top 8 Score" column H formula to also adjust with the selected pulldown date to show the competition results up to that period in time?

    After getting the last formula to work, I realized that if I were to have the "Top 8 Score" column update as well based on the date in the pulldown, the simple pulldown would allow me to see a snapshot of competitive stance at any point during the year and have the pre-match results to compare against. Very cool!

  20. #20
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    To add Top 8 Score, you just need a slight tweak to daddylonglegs' Prior Top 8 Score formula:

    =SUM(LARGE(IF((V$6:CJ$6="Combined")*(T$5:CH$5<=$A$3),V7:CJ7,0),{1,2,3,4,5,6,7,8}))

  21. #21
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    pb71, thanks for that, it worked. At first I forgot to use the cntr+shift+enter to enable it but after that, the data came up!

    I'll give it some tests today but I think everything looks great! Thanks for all the help!
    Last edited by mattmcg; 09-11-2010 at 02:01 PM.

  22. #22
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine LARGE with most recent data point excluded

    ------------------------------------------------------
    Last edited by pb71; 09-11-2010 at 03:19 PM. Reason: mattmcg was editing post #21 when I posted. Comments are no longer relevant.

  23. #23
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Well Daddylonglegs and pb71, your fixes have allowed me to use a date selection to provide the functionality I need. Thanks.

    I have one last question though. In the spreadsheet in post #17 above, I have one column that is not date adjusting and can't seem to get the array functionality to work correctly. I am trying to have the L column (# of matches) also adjust using a similar date array function. For example, if I choose June, the result would display "6" if the competitor participated in the first six matches.

    My idea was to create an array using the "combined" field again (columns V,AB,AH,AN,AT,AZ,BF,BL,BR,BX,**,CJ) and the COUNTIF function to count the number of times a person competes if the "combined" result is less than or greater than 0. If a positive or negative number is in the "combined" column, it would count it according to which date was selected in the pulldown match date (cell: A3).

    Can you help me construct this formula?
    Last edited by mattmcg; 09-20-2010 at 01:37 PM.

  24. #24
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    I've been trying to piece this one together myself but unfortunately to no avail.

    Here is the equation I came up with for the spreadsheet attached in post #17. This would post in cell L7:
    =COUNT(IF((V$6:CJ$6="Combined")*(T$5:CI$5<=$A$3),V7:CJ7<>0,0),{1,2,3,4,5,6,7,8,9,10,11,12})

    Needless to say, it does count but doesn't count the number of matches to the particular date. Any chance you folks can take a look?

  25. #25
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    Hello Matt,

    You could try SUMPRODUCT like this

    =SUMPRODUCT((V$6:CJ$6="Combined")*(T$5:CH$5<=$A$3)*(V7:CJ7<>0))

    or, since you have Excel 2010 you could also try COUNTIFS for the same result, i.e.

    =COUNTIFS(V$6:CJ$6,"Combined",T$5:CH$5,"<="&$A$3,V7:CJ7,"<>0")

  26. #26
    Registered User
    Join Date
    09-09-2010
    Location
    San Ramon, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Determine LARGE with most recent data point excluded

    Thanks, both worked!

    So I have to ask, is there a benefit to using one versus the other. Is COUNTIFS a 2010 only function? If I plan on sharing this with others that may not have Excel 2010, is it wise to use the SUMPRODUCT instead? Any downfall to this?

  27. #27
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,711

    Re: Determine LARGE with most recent data point excluded

    COUNTIFS is in Excel 2007 and later only so if you want to share with users who have Excel 2003 or earlier SUMPRODUCT is better.

    COUNTIFS is more efficient but unless you have thousands of rows of data you probably won't notice much difference

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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