+ Reply to Thread
Results 1 to 3 of 3

Adding value to a cell if two cells match

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Finland
    MS-Off Ver
    Excel 2007
    Posts
    14

    Adding value to a cell if two cells match

    Hi!

    I have a data that has result of soccer matches in Column A. The result values are 1, X or 2 (1=home win, X=draw, 2=away win). On colums B to AG I have predictions from different people on these matches. I want to add 3 points for every correct guess for the participants. So I'm trying to keep score on how every participant is doing on the predictions. How should I go about doing this most efficiently. I can achieve what I want by using a formula of =SUM(IF(E4=$B$4;3;0);IF(E5=$B$5;3;0);IF(E6=$B$6;3;0);IF(E7=$B$7;3;0); etc. but the function gets extremely long when there are lots of matches to predict.

    So in short: If cell A1 = B1, add 3 to cell C1, if cell A2=B2 add 3 to cell C1, if cell A3=B3 add 3 to cell C1 and so forth.

    Sorry for the confusing explanation. Hopefully someone can help out with these seemingly simple problem

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: Adding value to a cell if two cells match

    i would probably array your forumla.

    =SUM(IF($E$4:$E$7=$B$4:$B$7;3;0))

    entered with control shift enter
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    Finland
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Adding value to a cell if two cells match

    Thank you very much! That did excatly what I wanted... I tried to do it that way but I had already forgotten that one needs to press control shift enter to make arrays work

+ 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