+ Reply to Thread
Results 1 to 16 of 16

Generating a list of sports opponents from database

  1. #1
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Generating a list of sports opponents from database

    Let's say I have a database containing a large number of sporting matchups, like this:

    sample2.JPG

    I want to be able to generate a list of opponents and match numbers for any given participant (ie, what's shown in 'output) - basically, if player = x and match = y, put the opponent's name in the box next to y.

    I've been trying to do it using SUMIF or SUMPRODUCT, but I don't seem to be getting anywhere.

    Help please?
    Attached Files Attached Files
    Last edited by rubsley; 05-05-2020 at 08:19 PM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: Generating a list of sports opponents from database

    Dont' put an image better if you upload your example excel file, click on "Go Advanced" button then scroll down to find "Manage Attachment" text button to attach the file


    thank you

  3. #3
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Generating a list of sports opponents from database

    Oops. I thought I'd attached it but had actually attached the jpg (same file name).

    Done now. Thanks for the notice.

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: Generating a list of sports opponents from database

    Deleted Post

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    Try in G22 and fill down. I strongly suspect there is a simpler, more elegant solution. I just cannot seem to come up with it tonight.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: Generating a list of sports opponents from database

    Also not elegant, but uses helper columns.
    If in Column E and Column H you concatenate the names/Match# (E8 would be =C8&D8 and copied down)
    Then in G22 and copied down you could try:
    =IFERROR(IFERROR(INDEX($F$8:$F$14,MATCH($D$20&F22,$E$8:$E$14,0)),INDEX($C$8:$C$14,MATCH($D$20&F22,$H$8:$H$14,0))),"")

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    Gregb11 if you are not aware of it the IFERROR function isn't available in Excel 2003.

  8. #8
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: Generating a list of sports opponents from database

    Oops. Sorry. Thanks for letting me know.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    If you are interested you might find this link helpful. https://support.office.com/en-us/art...6-c6d90033e188

  10. #10
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: Generating a list of sports opponents from database

    Excellent - thank you!

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    This is simpler than my previous formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    @ Gregb11
    You are welcome. Glad to help.

  13. #13
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Generating a list of sports opponents from database

    Thanks for this, really appreciate it - I see that it works great for what I posted.

    Just wondering: what would I change (apart from the range) to accommodate it for up to around 200 matches? Is it the (1;1;1;1;1) part? Would that get really really long? And need updating when new matches get added?

    I've also been looking at this one:

    =INDEX($F$8:$F$14,MATCH(1,INDEX(($C$8:$C$14=$D$20)*($D$8:$D$14=F22),0,1),0))

    That works fine for when the player in question is in the home column, and seems like it should be easy enough to make it work for both - though my way of doing it is generally pretty clunky; something like:

    =IF(ISERROR(INDEX($F$8:$F$14,MATCH(1,INDEX(($C$8:$C$14=$D$20)*($D$8:$D$14=F22),0,1),0))),(INDEX($C$8:$C$14,MATCH(1,INDEX(($F$8:$F$14=$D$20)*($G$8:$G$14=F22),0,1),0))),(INDEX($F$8:$F$14,MATCH(1,INDEX(($C$8:$C$14=$D$20)*($D$8:$D$14=F22),0,1),0))))

    Thanks again. Look forward to hearing your thoughts on this.
    Last edited by rubsley; 05-06-2020 at 03:44 PM.

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    That array constant should be {1;1;1;1} (4 ones) because you are dealing with two offsetting ranges C8:F14 and D8:G14 whose overlap is 4 columns. Therefore you should not have to change that no matter how many matches you have to accommodate ... double check the syntax of MMULT.

    Try array entering this shorter version of the formula.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    You may find that you do not have to array enter this. You can try and see. My 2007 version is in another building and I am operating here with version 365 (which does not require Ctrl + Shift + Enter most of the time.) so I cannot test this myself.

  15. #15
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Generating a list of sports opponents from database

    Ah, that's good news that nothing needs changing depending on the size of the field. Phew.

    Do you know what I need to change to expand it to the full database? The sample has seven rows and when I add one more it seems I have to add an eighth "1" in the second array to make it work. But the actual database has around 5000 rows.

    Trying to avoid array formulas.
    Last edited by rubsley; 05-08-2020 at 03:01 PM.

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Generating a list of sports opponents from database

    I have two questions.

    1.) When you say "trying to avoid array formulas" are you trying to avoid Ctrl + Shift + Enter or is it something else? If you are not aware of it there are non-CSE array formulas.

    2.) In that last formula there should be no need for the 7 {1;1;1;1;1;1;1}. Check the syntax rules for MMULT. Since there will always and only be 4 relevant columns to work with the size of the database should not matter.

    I can make an non-CSE version of than last formula. Would you like that?

    Or am I miss-understanding something?

    Perhaps what you need are Dynamic Named Ranges. They automatically resize to fit the data. Is that it?
    Last edited by FlameRetired; 05-08-2020 at 05:18 PM. Reason: Afterthoughts

+ 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. Opponents opponents record
    By pilight in forum Excel General
    Replies: 10
    Last Post: 10-09-2019, 07:52 PM
  2. [SOLVED] Generating a register from a database
    By TheGomzee in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2019, 07:53 AM
  3. [SOLVED] Sports statistic database - various formulas required to display player performance
    By J_rice2004 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-17-2018, 05:39 PM
  4. [SOLVED] Determine the week of a sports season from a list of dates
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 05-16-2015, 06:28 PM
  5. build excel into a sports like database
    By laynlowz in forum Excel General
    Replies: 5
    Last Post: 04-11-2015, 01:24 PM
  6. Extract Opponents From List
    By scherich in forum Excel General
    Replies: 2
    Last Post: 08-07-2014, 10:59 AM
  7. Database + Generating Y Values
    By omairsyed in forum Excel General
    Replies: 1
    Last Post: 07-31-2009, 12:32 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