+ Reply to Thread
Results 1 to 8 of 8

Comparison:get a correct score

  1. #1
    Registered User
    Join Date
    06-02-2004
    Posts
    7

    Comparison:get a correct score

    Hi all,

    I have a football (that's soccer for those non UK residents!) prediction league with my brother and have decided to start using Excel to work out our scores,

    I have set up a spreadsheet where I enter our predictions and the actual score and would like Excel to compare the various cells.

    If we get a correct score, we get 3 points, a correct result(ie if we predict a home win and the game ends in a home win but not the score we predicted) 1 point, and no points for a completely wrong prediction.

    For the layout of the spreadsheet so far, please see the attachment.

    Hoping someone can help me.

    Many thanks,

    Lee
    Attached Files Attached Files

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    re: Comparison:get a correct score

    Hi,

    In O3

    =IF(C3&E3=K3&M3,3,IF(OR(AND(C3>E3,K3>M3),AND(C3<E3,K3<M3),AND(C3=E3,K3=M3)),1,0))

    should get you started
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    06-02-2004
    Posts
    7

    re: Comparison:get a correct score

    sweep,

    That's exactly what I was looking for.

    Huge thanks for a quick response!

  4. #4
    Registered User
    Join Date
    06-02-2004
    Posts
    7

    re: Comparison:get a correct score

    Just thinking, is there any way I could add in a condition that if the Actual Score box is empty, it will display "-" as otherwise, Excel calculates the two empty boxes as being a draw.

    Thanks

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    re: Comparison:get a correct score

    =if(c3&e3=k3&m3,3,if(or(and(c3>e3,k3>m3),and(c3<e3,k3<m3),and(c3=e3,k3=m3)),1,if(k3&m3="","-",0)))

  6. #6
    Registered User
    Join Date
    06-02-2004
    Posts
    7

    re: Comparison:get a correct score

    Thanks, thats almost there, but if either of us predict a draw, then even if the Actual Score cells are blank, it shows us as getting a point.

    (possibly because if K3 and M3 are both empty, Excel treats them as the cells being the same and calculates it as a draw?)

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    re: Comparison:get a correct score

    This is why someone else should always check your code for you!

    =IF(C3&E3=K3&M3,3,IF(OR(AND(C3>E3,K3>M3),AND(C3<E3,K3<M3),AND(C3=E3,K3=M3,NOT(K3&M3=""))),1,IF(K3&M3="","-",0)))

  8. #8
    Registered User
    Join Date
    06-02-2004
    Posts
    7

    re: Comparison:get a correct score

    Quote Originally Posted by sweep View Post
    This is why someone else should always check your code for you!
    Glad I could be of assistance

    Many many thanks for all your work.

    All the best.

+ 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