+ Reply to Thread
Results 1 to 23 of 23

Correlating data: Which function(s).

  1. #1
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Correlating data: Which function(s).

    Hi all,

    I'm sorry, I don't know what to title this. If someone suggests something better, I'll gladly change it.

    Explanation:-

    I have a column of cells (300+ entries long) containing up to 20 distinct but randomly placed/repeating names (text) which have been generated from a VLOOKUP. The column adjacent to the list of names is used to manually enter a numeric (value between 0 to 9). What these are is a list of team names playing in a fixture with weekly scores against them.

    I have another column containing the names (once only, so naturally max 20 entries long). In columns adjacent to this list of names, I want to show various calculated results relevant to each team.

    Question is:-

    What formula(s)/expression(s) do I need to consider (attempt to learn) to extract results relevant to each team name in the main (first mentioned) list above?.

    Thanks,
    J.
    Last edited by Jo-Jo; 11-28-2009 at 08:50 PM. Reason: Marked Solved

  2. #2
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    If I understand correctly, SUMIF should work. If your first list is A1:B300 and your list of names is D1:D20, E1 can have =SUMIF(A$1:A$300,D1,B$1:B$300)
    If this is not right, could you please post a workbook showing what you mean?

  3. #3
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Hello darkyam,

    You made better sense out of my message than you anticipated. I tried and it works perfectly. I just need to create a little routine to test for all scores/options... thank you

    Now I've been advised to ask my question one at a time and this was always going to be a multi-parter, so can I throw in an extra facet and ask for advice please:-

    I actually have TWO main lists, following the example of A1:B300 there is another two colums C1:D300 which are the same format as the first list (names in the first column, scores in the second). This is because, naturally, each team needs to play another and that teams scores also need to be manually entered.

    As this second list contains the same 20 team names as the first, I need to combine the results in E1. Is there an addition/modification I can make to this formula or would I need to combine the results in some kind of holding see (if that makes sense)?.

    Thanks
    J.
    PS: darkyam, I did previously upload a sample w/sheet, but it was suggested (quiet rightly) that it was rather large and a bit of an imposition to expect members to download it. So I'm trying my best with descriptive text.

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    Simply put two SUMIFs in the formula. =SUMIF(A$1:A$300,F1,B$1:B$300)+SUMIF(C$1:C$300,F1,D$1:D$300)

  5. #5
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Guess what this means

    Thank you darkyam.

    I won't marked this solved yet, as there are a couple of more aspects to add , but I need to work out how to describe them.

    Can I ask one thing in the meantime... is there a way to prevent the zero displaying in the result list, if scores haven't yet been entered agains a team?

    Thanks.

  6. #6
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    There are two ways:
    1. Another IF function: If(SUMIF1+SUMIF2=0,"",SUMIF1+SUMIF2)
    2. Custom format of #;;

  7. #7
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    I'll have a go at working out option 2. If I eventually add more functions to this expression it could finish up extremely long.

    Very many thanks for your help darkyam... much appreciated.
    J.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Correlating data: Which function(s).

    =SUMIF(A$1:A$300,F1,B$1:B$300)+SUMIF(C$1:C$300,F1,D$1:D$300)
    FWIW, given the layout of your data and the fact that the data types are alternating I would say you could actually get away with a single SUMIF:

    =SUMIF($A$1:$C$300,$F1,$B$1:$D$300)

    Re: the 0's - I'd go with the custom number format route as advised.

  9. #9
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Quote Originally Posted by DonkeyOte View Post
    FWIW, given the layout of your data and the fact that the data types are alternating I would say you could actually get away with a single SUMIF:

    =SUMIF($A$1:$C$300,$F1,$B$1:$D$300)
    Brilliant, that is working too. Thank you DonkeyOte.

    This is what made me hesitant about breaking-up my questions, because I didn't want people to have to double work my questions... so I apologise for that, but it is helping me learn (slowly ).

    Thanks guy's,
    J.

  10. #10
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Hi all,

    The advice above is all working for me. Now I need help (please) to expand this formula:-

    =SUMIF($C$18:$E$397;$H18;$D$18:$F$397)

    Where Col C and Col E = team names. Col D and Col F = team scores

    I want to achieve a sum count for each team when they play a match i.e.: total of matches played for each team.

    I assume (please correct me if I'm off track!) that the way to go is to find 'any' entry that is 'not blank' (a team might score 0!) in the scores column.

    Any suggestions please?

    Thanks,
    J.

  11. #11
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    Is the schedule entered as teams play games (i.e., nothing is entered at all until a match has actually been played) or is it entered ahead of time with just the scores filled in?

    If the former, just change SUMIF to COUNTIF and delete the last argument. If the latter, try =SUMPRODUCT(($C$18:$E$397=H18)*($D$18:$F$397<>""))

  12. #12
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Hi again darkyam,

    The team names are filled in the beginning of each season from a VLOOKUP, the number of team names being dependant on another fixed formula table. The scores entered on a weekly (as played basis).

    The SUMPRODUCT worked perfectly . Thanks yet again.

    I'm elated and a tad dissapointed, because I thought I would possibly be adding another function to the original formula, which could have led me on the path of helping myself to work out expressions for other columns, but elation rules

    So can I ask:- I have, as I say other calulations to perform from the entered results. The next are going to be:-

    1. count the 'wins' for each team which in effect is any score greater than 4.
    2. count the 'loses' ....... any score less than 4.

    Will these mean adding another function to the first formula. If so are they things that I can try to work out myself... with a hint.

    Thanks,
    J.

  13. #13
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    What do you want to happen if the score is exactly 4?

  14. #14
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    To answer the question, though, if a win is 4 points or more, you'd use =SUMPRODUCT(($C$18:$E$397=H18)*($D$18:$F$397>=4)) for the wins. If it's only more than 4 points, then replace >= with >. Losses would simply be games - wins.

  15. #15
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Very sorry darkyam, my mistake for getting too excited

    There a 9 games to a match set so the trigger between win and loose is 5 not 4.

    I'm off to try your suggestion (with 5 )... thanks again.
    J.

  16. #16
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Good morning all,

    I've hit a problem.

    I am using this formula as kindly suggested above:-

    =SUMPRODUCT(($C$18:$E$397=H18)*($D$18:$F$397<>""))

    which is copied down into 20 cells.

    The problem I'm having is when I get down to a 'H' column cell that doesn't contain data (not that many teams playing, so no team name), then the remainder of the list has spurious results. [e]it should be blank[/e]

    I've fiddled, twiddled and kicked the cat, but nothing helps.

    Any suggestions what I should poke around in please?

    Thanks,
    J.
    Last edited by Jo-Jo; 11-26-2009 at 09:58 PM. Reason: Added info.

  17. #17
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    Kick the cat again. I'm sure it's withholding the answer from you.

    Seriously, though, why are you copying the formula down past your list of names? If you want it to return blank, a simple =IF(H18="","",<current formula>) should work, but I don't see the point in having it go beyond your list of names since you know the teams that will be playing from the beginning of the season.

  18. #18
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Hi darkyam,

    I'll try to explain...

    The list of team names is populated according to how many team are playing in any given season. The fixture formula allows for between 4 - 20 teams. So if there are only ten teams playing the list gets populated accordingly with:-

    =IF(ROW(H18)-17<=Setup.$E$11;Setup.C18;"")

    It's really for tidyness and later printing... I hope.

    Does that make sense?

    Here I go to try the suggestion... I'll report back.

    Cats left home and the real bad news is I'm giving up pool and taking up darts next weeks

    Thanks
    J.

  19. #19
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    I've added IF part and it works in as much as all except the first entry is blank, the first still has a spurious number!

    [e]its 04:40 over here and I've been at this since 11:00am yesterday, I'm gonna give it a fresh pair of eyes in a couple of hours[/e]

    Thanks for all your help today darkyam.
    J.
    Last edited by Jo-Jo; 11-26-2009 at 11:45 PM.

  20. #20
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    Could you post an updated workbook? The formulas should work. And don't worry, I don't have a data plan to worry about. Just please don't zip it, as I seem to have problems opening any files from here that are zipped.

  21. #21
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Good afternoon all,

    Hi darkyam,

    I 'think' I've cracked it and the cat has come back home

    I'm not 100% sure I've adapted the formulas optimally, but it seems to be working as expected (testing of different scenarios... on-going).

    I'm happy to upload if you still wish...?. Along with the testing, I'm now thinking how to create a couple of print-out and a website format (the cat won't be around much longer )

    Thanks again,
    J.

  22. #22
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Correlating data: Which function(s).

    If it's working, no need to upload it. I would, however, suggest that additional questions be asked in a new thread. The reason is, when contributors here see a thread with over five responses, they tend to assume that there's a lot of history for them to understand before they can help and that a solid dialogue regarding the situation is already taking place, so many of them ignore those threads and focus on ones with few responses. Starting new threads will get you help more quickly if I don't happen to be online at the time. If the question is particularly relevant to this thread, you can always post a link back here.

  23. #23
    Registered User
    Join Date
    11-13-2009
    Location
    Espaņa
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Correlating data: Which function(s).

    Hi darkyam,

    Thanks very much for all your help in this thread... much appreciated.

    J
    Last edited by Jo-Jo; 11-28-2009 at 08:51 PM.

+ 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