+ Reply to Thread
Results 1 to 14 of 14

Splitting and ranking data

  1. #1
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Red face Splitting and ranking data

    Hi Guys,

    I'm pretty much a novice on excel so any help I can gain here is much appreciated. I'm trying to use excel to help me automate a system for calculating the starting positions of karts in a particular race format at an indoor kart track. I've managed to sort out a qualifying session and then the semi finals. However, I can't then arrange the grids for the finals.

    I've attached a sheet to show you how far I've got so far. All I need to work out how to do is to organise the names of the drivers into the correct starting order for the final races. The two first place finishers from the heats will be first and second in the A final (first being the one with the fastest lap of the two drivers, 2nd being the slower), the two second place drivers from the heats will be 3rd and 4th in the A final (3rd being the driver with the faster of the two laps) and so on...

    The only other tricky bit is that there are not always 16 people in the race. Sometimes there are less. The finals are then just half the drivers in each, if it's an odd number the A final will be the larger of the two races. (i.e. if there are 11 drivers there will be 6 in the A final and 5 in the B final).

    I hope I've managed to explain the problem and that there is a simple solution to this problem.

    Many thanks in advance.

    Ben
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Splitting and ranking data

    It's not pretty but try this.
    In the top grid
    =IFERROR(IF(VLOOKUP(ROWS($A$1:A1),$I$3:$J$10,2,FALSE)<=VLOOKUP(ROWS($A$1:A1),$I$11:$J$18,2,FALSE),INDEX($H$3:$H$10,MATCH(ROWS($A$1:A1),$I$3:$I$10,0)),INDEX($H$11:$H$18,MATCH(ROWS($A$1:A1),$I$11:$I$18,0))),IF(COUNTIF($I$3:$I$18,ROWS($A$1:A1))=1,INDEX($H$3:$H$10,MATCH(ROWS($A$1:A1),$I$3:$I$10,0)),"")) copied down 8 rows
    In the bottom grid
    =IFERROR(IF(VLOOKUP(ROWS($A$1:A1),$I$3:$J$10,2,FALSE)>VLOOKUP(ROWS($A$1:A1), $I$11:$J$18,2,FALSE), INDEX($H$3:$H$10,MATCH(ROWS($A$1:A1),$I$3:$I$10,0)),INDEX($H$11:$H$18,MATCH(ROWS($A$1:A1),$I$11:$I$18,0))),"")
    copied down 8 rows.
    See attachment
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    Hi ChemistB,

    Thanks for the reply.

    I'm not sure I explained the process of calculating the grid out correctly as the results gained are not correct. I've attached the sheet again but this time I've added a table below your sheet with the correct grids. I have inputted these manually so they are correct. It should also make it easier to understand exactly what i want the function to calculate. Sorry for any confusion.

    Thanks again,

    Ben
    Attached Files Attached Files

  4. #4
    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,853

    Re: Splitting and ranking data

    How can Vicky have come first with the slowest lap in her semi?
    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.

  5. #5
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    That's just her one off fastest lap. The others may have just done one fast lap or crashed etc.. The semi finals are held over 15 laps and the winner is the first over the line not the one who has the fastest lap.

    The fastest laps are only used to differentiate between the winners of the two heats, the two second place driver etc..

    That's what I don't think I made very clear in my first explanation, hence why I've manually entered the results to try and clarify.

    Thanks.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Splitting and ranking data

    Okay, I suggest you use a helper column (I used K) with this formula starting in K3
    =IF(ISNUMBER(I3),I3*100+J3,"")
    You can hide this column if you want.

    Then in O3 copied down through Group A
    =IF(INT((COUNTA($H$3:$H$18)+1)/2)>=ROWS($A$1:A1),INDEX($H$3:$H$18,MATCH(SMALL($K$3:$K$18,ROWS($A$1:A1)),($K$3:$K$18),0)),"")
    In O11 copied down
    =IF(INT((COUNTA($H$3:$H$18))/2)>=ROWS($A$1:A1),INDEX($H$3:$H$18,MATCH(SMALL($K$3:$K$18,ROWS($A$1:A9)),($K$3:$K$18),0)),"")
    See attachment
    Attached Files Attached Files

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Splitting and ranking data

    Or, without a helper column, in N3 and copy down to N18, array formula**:

    =IF(ROWS($1:1)>COUNTA($H$3:$H$18),"",INDEX($H$3:$H$18,MATCH(SMALL(IF($I$3:$I$18<>"",$I$3:$I$18+$J$3:$J$18/10^12),ROWS($1:1)),IF($I$3:$I$18<>"",$I$3:$I$18+$J$3:$J$18/10^12),0)))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Splitting and ranking data

    Nice XOR
    Except I don't think it takes into account this bit;
    ... that there are not always 16 people in the race. Sometimes there are less. The finals are then just half the drivers in each, if it's an odd number the A final will be the larger of the two races. (i.e. if there are 11 drivers there will be 6 in the A final and 5 in the B final).

  9. #9
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    ChemistB,

    Thanks again. Much closer! Only one slight Issue now. When there are only 12 drivers it calculates two finals. One with 8 drivers and one with 4, this needs to be 6 in each.

  10. #10
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    Chemist B,

    When I enter details for 16 or 15 drivers the results are great. However, any less than this and I get an error message in the names column. Any ideas?

    Thanks for your time, I appreciate your help greatly.

    Ben

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Splitting and ranking data

    I needed to modify the formula in O11 down to
    =IF(INT((COUNTA($H$3:$H$18))/2)>=ROWS($A$1:A1),INDEX($H$3:$H$18,MATCH(SMALL($K$3:$K$18,SUMPRODUCT(--(LEN($O$3:$O10)>0))+1),($K$3:$K$18),0)),"")
    That should do it.

  12. #12
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    ChemistB you are a superstar!

    Thank you so much. If you are ever in the UK let me know and you can come karting for free!!

    Just one last problem. When you remove drivers from the semi final i.e. delete so there are 12 not 16 the sheet works perfectly. However, If you remove them from the qualifying session (yes, the part that I did initially!) it doesn't work correctly and we end up with 8 and 4 drivers in the finals. Not 6 & 6.

    Hopefully this will be the last time!
    Last edited by ForumHelp; 03-25-2014 at 12:58 PM. Reason: I'm an excel novice

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Splitting and ranking data

    I think you'll need to upload an example where some things are not working.

  14. #14
    Registered User
    Join Date
    03-25-2014
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Splitting and ranking data

    Hi again,

    I've attached the file as requested with the errors in. As before I've also manualy enterred the correct grids in the table below.

    Sorry I've not been explaining this too well.

    Thanks again.

    Ben
    Attached Files Attached Files

+ 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] Ranking up to 15 numbers in column D Ranking skips 7 with a tie at 6 and 2
    By Securitysports in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-03-2013, 07:11 AM
  2. How do I combine splitting data into files then splitting the new files data into multiple
    By Lauraguthrie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 01:18 PM
  3. [SOLVED] Automatically sort the data and ranking based on the sorted data
    By rakesh2806 in forum Excel General
    Replies: 6
    Last Post: 01-07-2013, 03:51 PM
  4. Replacing the existing Data of workbooks on splitting Data in a Master workbook
    By anchuri_chaitanya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2012, 11:59 AM
  5. Replies: 6
    Last Post: 06-01-2010, 06:19 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