+ Reply to Thread
Results 1 to 5 of 5

identify rankings according to gender - Excel VBA

  1. #1
    Registered User
    Join Date
    10-16-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    identify rankings according to gender - Excel VBA

    Excel VBA - I have this worksheet that have contestant name, gender and racing time. so for eg I have:

    Name | Gender | Time | Overall | MaleRank | FemaleRank
    Mitch | Male | 15.06
    Jess | Female | 16.06
    Rach | Female | 17.07
    Will | Male | 17.09
    and so on...

    I want the system to be able to identify the overall(Both male and female) 1st, 2nd and 3rd places under the Overall column, I also want it to be able to identify the Female 1st, 2nd and 3rd places and identify them under FemaleRank column. So same for Male1st, 2nd and 3rd and identify them under MaleRank. All of the ranks need to be calculate with a button click in excel vba forms. So after I clicked the button, the above example will display:

    Name | Gender | Time | Overall | MaleRank | FemaleRank
    Mitch | Male__ | 15.06 | 1st___| 1st Male _|
    Jessy | Female |16.06 | 2nd___|_________| 1st Female
    Rache | Female |17.07|_______|_________| 2nd Female
    Wille | Male__ | 17.09 | 3rd____| 2nd Male |
    and so on...

    p.s the time will first be sorted in ascending order and pls ignore the __'s as they are use to make the columns look more understandable. Actually any kind of way to identify the 1st, 2nd and 3rd places is fine but this is the only way I can think of(by making 3 new columns)...
    I don't know how to do it, can anyone give me a hint? Thanks.
    Last edited by Michael007; 10-24-2011 at 07:53 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: identify rankings according to gender - Excel VBA

    Hi,

    I know you asked for vba but the formula in the attached should give you what you want. Thought I'd post it as an option.

    Dom
    Attached Files Attached Files
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    10-16-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: identify rankings according to gender - Excel VBA

    Thanks for the reply. And yeah that's pretty much what I want it to be like, but I only needed the top 3 places for overall, female and male. And is there a way I can integrate the formula into vba code? or is the vba code to do it completely different? Because I need it to be vba codes. I need it to be able to loop through the Time and identify the 1st, 2nd and 3rd places. Anyone pls help
    Last edited by Michael007; 10-24-2011 at 09:27 AM.

  4. #4
    Registered User
    Join Date
    10-16-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: identify rankings according to gender - Excel VBA

    I think displaying the results in additional columns might be too hard to read. Is there a way to highlight the 1st,2nd and 3rd for overall, female and male(highlight the entire row, not just the time)

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: identify rankings according to gender - Excel VBA

    You could probably do that using conditional formatting but you would need to decide what formatting should take priority where someone was overall 1/2/3 and also Male or Female 1/2/3.

    Dom

+ 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