+ Reply to Thread
Results 1 to 14 of 14

Goal difference for last 3 matches wanted

  1. #1
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Goal difference for last 3 matches wanted

    Hello.
    I'm trying to find the goal difference for each team over a period of 3 weeks. With the fixtures showing at the top, I want the goal difference for the home and away teams to show in columns C and D respectively. For example, over the past 3 games Cardiff have scored 5 goals and conceded 7, goal difference -2. Brighton have scored 3 and conceded 3, goal difference 0.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Goal difference for last 3 matches wanted

    Where do you want the output to go, its not clear?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    Sorry. The results for the home team in cell C3 and the away team in cell D3.
    Thank you.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Goal difference for last 3 matches wanted

    Change the values in columns C and D to numbers, they're currently text so SUMPRODUCT isnt working.
    Once youve done that

    in C3
    =(SUMPRODUCT(--(A$15:A$46=A3)*(C$15:C$46))+SUMPRODUCT(--(B$15:B$46=A3)*(D$15:D$46)))-(SUMPRODUCT(--(A$15:A$46=A3)*(D$15:D$46))+SUMPRODUCT(--(B$15:B$46=A3)*(C$15:C$46)))

    There may be a shorter way

  5. #5
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    I've changed the values in columns C and D to numbers but I'm getting a #VALUE error in C3.

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Goal difference for last 3 matches wanted

    Reenter the values again, and the formula works.
    Dont just change the format, reenter the values.

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Goal difference for last 3 matches wanted

    i suggest posting the workbook that is not working or typing a 1 in a cell copying it and paste special multipying the values in columns c and d

  8. #8
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    I've typed 1 in a cell, copied it and used paste special with multiplying into cell C3 then pasted the formula into C3. It's still producing a #Value error.
    Thank you.

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Goal difference for last 3 matches wanted

    So use the other suggestion of renetering the values again

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Goal difference for last 3 matches wanted

    File attached
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    It's kind of working now but some of the results are incorrect. Looking down the results, Tottenham have scored 4 and conceded 3 (goal difference 1) but it shows '4'.
    Thank you.

  12. #12
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    Am I correct in thinking that I can copy the formula across into Cell D3?

  13. #13
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    The results in C3:C12 are correct, but the results in D3:D12 are wrong.
    Thank you.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: Goal difference for last 3 matches wanted

    I've changed the formula in D3 from =(SUMPRODUCT(--(B$20:B$51=B8)*(D$20:D$51))+SUMPRODUCT(--(C$20:C$51=B8)*(E$20:E$51)))-(SUMPRODUCT(--(B$20:B$51=B8)*(E$20:E$51))+SUMPRODUCT(--(C$20:C$51=B8)*(D$20:D$51)))
    to
    =(SUMPRODUCT(--(B$20:B$51=B8)*(D$20:D$51))+SUMPRODUCT(--(A$20:A$51=B8)*(C$20:C$51)))-(SUMPRODUCT(--(B$20:B$51=B8)*(C$20:C$51))+SUMPRODUCT(--(A$20:A$51=B8)*(D$20:D$51)))
    and it works fine now.
    Thank you.

+ 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] to sum 6 matches from a list and to count the goal difference.
    By andyh42 in forum Excel General
    Replies: 8
    Last Post: 01-15-2018, 10:02 PM
  2. to sum 6 matches from a list and to count the goal difference.
    By andyh42 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-27-2017, 12:55 PM
  3. Replies: 1
    Last Post: 04-26-2014, 08:28 AM
  4. Replies: 9
    Last Post: 04-19-2014, 02:28 PM
  5. [SOLVED] Macro to check data for matches and return a difference
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-27-2013, 10:59 AM
  6. Help Wanted with Excel Goal Seek
    By donnydon in forum Excel General
    Replies: 1
    Last Post: 08-26-2011, 05:18 AM
  7. sorts on goal difference
    By rfc5141 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2007, 08:09 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