+ Reply to Thread
Results 1 to 16 of 16

IF & AND Functions - Correct Score Predictor

  1. #1
    Registered User
    Join Date
    01-19-2016
    Location
    Edinburgh
    MS-Off Ver
    Excel 2013
    Posts
    17

    IF & AND Functions - Correct Score Predictor

    Hi everyone,

    New to this forum, hopefully I post in the right place. Here's what I am trying to do - set up a fantasy football type formula in Excel for predicting soccer scores.

    If someone predicts 2-1, and the correct score in the match is 2-1, they will receive 5 points for CORRECT SCORE. If someone predicts 3-1 but the correct score is 2-1, they get 2 points for predicting CORRECT RESULT. If they get neither the score correct or the result correct - nil points I'm afraid.

    Anyway, I am trying to combine the IF function and the AND function, to try and score this. Take 2-1 as the predicted score, and 2-1 as the correct score for now:

    2 is in one predicted cell (A1), and 1 is in the other (B1) - the correct score 2 (C1) and the correct score 1 (D1) are in a further 2 cells. What I need to be able to do is say:

    If A1=C1 and B1=D1, give the score as 5 points. It was my belief that this was done by: =IF(AND((A1=C1;B1=D1),5,0)), however I can't seem to get this working.

    It may be just the fact I am doing this completely wrong, or there is a comma in somewhere, but any help on this matter would be appreciated muchly.

    Cheers guys,
    John-Boy

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: IF & AND Functions - Correct Score Predictor

    try using
    =IF(AND(A1=B1,C1=D1),5,0)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF & AND Functions - Correct Score Predictor

    Try this

    =IF((A1>B1)-(C1>D1),0, IF(AND(A1=C1, B1=D1), 5,2))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: IF & AND Functions - Correct Score Predictor

    Welcome to the forum.

    For just that part of the problem, use this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (you may need to replace the commas , with semi-colons ; depending on your settings).


    Edit: I was beaten to the answer - and ChemistB gave you the better solution, including the 'correct result but not correct score' points, too.
    Last edited by Aardigspook; 01-19-2016 at 06:35 PM. Reason: Edit: beaten to it, twice!
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Registered User
    Join Date
    01-19-2016
    Location
    Edinburgh
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: IF & AND Functions - Correct Score Predictor

    Thanks Hemesh - that worked! The forum I found before had the double brackets in, something which confused me but obviously not enough to confuse me to correct them!

    ChemistB - thanks, trying this now. That was my next question, how to solve for 5,2 and 0. Baby steps I'm taking!

  6. #6
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: IF & AND Functions - Correct Score Predictor

    Parentheses placement

    =IF(And(A1=C1,B1=D1),5,0)

    This gives 5 points when both match, 0 otherwise. If you want to give 5 points when both match and 2 points when one matches, try this:

    =IF(AND(A1=C1,B1=D1),5,IF(OR(A1=C1,B1=D1),2,0))

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: IF & AND Functions - Correct Score Predictor

    You are welcome ! thanks for the feedback.
    Your second query i think is already resolved by ChemistB

    in case your query is resolved you can mark the thread as solved.

    I would appreciate if you click the little star icon below the post of all who helped you

    Thanks and regards

  8. #8
    Registered User
    Join Date
    01-19-2016
    Location
    Edinburgh
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: IF & AND Functions - Correct Score Predictor

    Hi Raymundus,

    The formula from ChemistB actually works, assuming the first number is still bigger than the 2nd one, (2-1 for example), however if it were reversed 1-2, and the correct score was 1-3, this would in fact give a zero when it should be 2 points?

  9. #9
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: IF & AND Functions - Correct Score Predictor

    To be sure I understand, are you concerned with the numbers simply matching, or does the first number need to be bigger than the second to earn points? Meaning, if the score is 2-1, you want points, but if the score was 1-2 and the prediction was 1-2, you still want points?

    What if the Prediction is 2-1 and the score is 0-1? They picked the wrong winner, but one number matches. Should points be awarded?

  10. #10
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: IF & AND Functions - Correct Score Predictor

    I'm off to the second job... If ChemistB picks up, great! If not, I'll check in tomorrow morning.

  11. #11
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: IF & AND Functions - Correct Score Predictor

    Try this amendment to ChemistB's formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It gives the following results when I tested it:
    A B C D E
    2 1 2 1 5
    2 1 3 1 2
    2 1 1 2 0
    1 2 1 2 5
    1 2 1 3 2
    1 2 2 1 0
    2 2 2 2 5
    2 2 3 3 2
    2 2 1 2 0
    2 2 2 1 0
    1 5 0 0 0
    3 3 0 0 2
    3 3 3 0 0
    3 3 0 3 0

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF & AND Functions - Correct Score Predictor

    Hi All,
    My formula screws up with ties. Aardigs formula seems to do the trick.

  13. #13
    Registered User
    Join Date
    01-19-2016
    Location
    Edinburgh
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: IF & AND Functions - Correct Score Predictor

    @Aardigspook

    Lifesaver - thank you very much! It has worked a treat :D appreciate the help, everyone!

  14. #14
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: IF & AND Functions - Correct Score Predictor

    You're welcome.
    If your problem is now solved, please go to 'Thread Tools' above your first post and select 'Mark thread as solved' - this lets people know that this thread has an answer, which might be useful to anyone with a similar problem. Thank you.

  15. #15
    Registered User
    Join Date
    06-01-2018
    Location
    Los Angeles
    MS-Off Ver
    windows 10
    Posts
    1

    Re: IF & AND Functions - Correct Score Predictor

    How about if we give just 2 points to predictions for draws but incorrect score.
    For instance the final score is Russia 2 KSA 2, I have predicted 0-0 so i should just get 2 pts.
    For draws I just want to give 5 pts for exact result or 2 points for calling the draw
    there is no goal difference pts on draw.. what is the equation for this part/
    Thanks

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,836

    Re: IF & AND Functions - Correct Score Predictor

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Need a Macro that enters a score if the correct conditions are met (File Attached)
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-05-2015, 11:53 AM
  2. Football Predictor
    By EMcK in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-27-2014, 08:17 PM
  3. NRL Ladder Predictor
    By ExcelSipi in forum Excel General
    Replies: 2
    Last Post: 04-05-2014, 03:03 AM
  4. Replies: 1
    Last Post: 02-25-2013, 04:25 PM
  5. Replies: 2
    Last Post: 03-20-2012, 06:30 PM
  6. Replies: 3
    Last Post: 08-31-2011, 09:11 AM
  7. Comparison:get a correct score
    By :-) in forum Excel General
    Replies: 7
    Last Post: 02-18-2010, 10:12 AM

Tags for this Thread

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