+ Reply to Thread
Results 1 to 11 of 11

Help generating two rankings for seperate subjects

  1. #1
    Registered User
    Join Date
    03-24-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    9

    Post Help generating two rankings for seperate subjects

    Hi,

    I need to generate 2 ranking list.
    The session number is based on the date, while the trial number is based on the time within each session.
    Also each session and trial list has to be based on the subject (name).

    I attach an example with how i want the final result to look.

    Very appreciative for help with creating a formula for this. The data consists of 3600+ trials as of now, from 40ish subjects, and more will be added.

    Thanks,
    /John
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Help generating two rankings for seperate subjects

    According to testing by matching expected values in the file attached to post #1, the following formulas work for Session and Trial respectively:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    03-24-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Help generating two rankings for seperate subjects

    Hi and thanks for your help.

    Im not sure if i understand the formula, as it includes the "D" column, which is suposse to be empty (I just included it to show how the final result should look).
    So what formulas will generate the content in column D, using info from columns ABC (and maybe a 4th new column), and same goes for generating the content of column E.

    I've tried using =SUMPRODUCT(--(A2=$A$2:$A$26),--(B2>$B$2:$B$26))+1
    But then the list will skip ranks (1,1,1,1,5,5,7,7, etc)

    When using =SUMPRODUCT(--(A6=$A$2:$A$26),(--(B6>B$2:B$26)))/COUNTIF(A$2:A$26,A6)+1
    The list generated has decimals (1,1,1,1,1.5,1.5,1.75,1.75, etc)

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Help generating two rankings for seperate subjects

    Column D is ranking the sessions. It could be any column, for example column R, and the formula would simply change to include references to that column, for example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It just seems easy to reference the sessions ranking column when compiling the trial ranking column, can't really understand the restriction to columns A, B and C in this instance. If the session ranking is in another column, as in the example above, then the formula would change to reference that column, as in:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached is your file with the formulas applied which may provide more clarity.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-24-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Help generating two rankings for seperate subjects

    Ahh, Perfect!

    I was confused and didnt realize that it was refering to itself.
    Thanks a lot for the solution and your explanation.

    /John

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Help generating two rankings for seperate subjects

    Or try this ...

    In D2:

    =IF(AND(A2=A1,B2=B1),D1,MAX(IF($A$1:A1=A2,$D$1:D1))+1)

    Enter with Ctrl+Shift+Enter

    In E2:

    =IF(D2<>D1,1,E1+1)

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Help generating two rankings for seperate subjects

    You're Welcome, thank you for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

  8. #8
    Registered User
    Join Date
    03-24-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Help generating two rankings for seperate subjects

    I noticed a dilemma with both formulas, and that is that it has to be sorted before applying the formulas. If I add new data later, they just get new session rank even though it has the same date as previous sessions. And if a date wasnt in order it follows the sequence.

    The formula:
    =1+COUNTIFS(A$2:A$26,A2,R$2:R$26,R2,C$2:C$26,"<"&C2)

    takes though the time in to account, and returns the correct rank, even if it isnt sorted in advance.
    =IF(D2<>D1,1,E1+1) Works though only if every thing is sorted, as it just adds one to the previous rank.

    Any idea how to solve the issue with the Session ranking?

    /John
    Attached Files Attached Files
    Last edited by hassjohn; 10-17-2016 at 09:41 AM. Reason: Added example (see line 34-37 & 209-213)

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Help generating two rankings for seperate subjects

    Not sure that I understand what you are looking for. If I append the list by adding fp001 20130106 6:00:51 in A27:C27, and update the formulas to include that row, then even if it did show the correct session and time rankings, 3 and 1 (which it doesn't), wouldn't that be confusing as the values in the row above, fp005 20130223 5:28:58 also return 3 and 1. Seems as if it would be less confusing to sort the data by name and then date when new data is entered. Of course I may be missing the bigger picture here, and if so I'd suggest re-uploading your file with an example of the situation that is causing the dilemma, indicate where the formula(s) fail, and manually enter, again only where the formula(s) fail, values for session and time.
    I do see one thing that need revising, to accommodate appending of the data, which is for both formulas to use whole column referencing as follows:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let me know if you have any questions.

  10. #10
    Registered User
    Join Date
    03-24-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Help generating two rankings for seperate subjects

    The problem was for row 34-37 & row 209-213, when subject VP023 had some extra sessions added that were not sorted.
    In the raw data the date and time is in one column in this format (10/9/2013 5:50:32 PM), since we extract it from pdf files. Since its in single digit rathen then two digit format, the sorting doesnt really work. I fix it on a different sheet though, getting the YYYYMMDD format and seperating the time, and then use it for the ranking (which becomes the session/trial number). The data that i want to analyz remains though in the raw data, making me want to keep the original positions.

    But i think I will just reorganize it a little, getting every thing on the samt sheet and use the sorting by name/date/time, as it would solves it.

    Thanks for your help, really appreciated.

    /John

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Help generating two rankings for seperate subjects

    You're Welcome, let us know if you need further assistance and best of luck on your project. Please take a moment to re-mark the thread as 'Solved'.

+ 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. Analising scores per subjects
    By Arealmix in forum Excel General
    Replies: 4
    Last Post: 05-03-2014, 05:10 PM
  2. [SOLVED] Generating a macro output in a seperate workbook
    By bmbalamurali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2013, 11:01 AM
  3. [SOLVED] Using excel to group email subjects
    By ahblur in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-23-2013, 10:41 PM
  4. Replies: 2
    Last Post: 06-10-2013, 03:16 AM
  5. Number of subjects help
    By eyemage in forum Excel General
    Replies: 10
    Last Post: 11-03-2012, 03:31 PM
  6. converting weekly rankings into monthly rankings
    By sfinns in forum Excel General
    Replies: 6
    Last Post: 02-09-2012, 08:51 AM
  7. Sorting subjects into groups
    By tony_winter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 05:37 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