+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Countif - 2 criterias

    Hey guys

    I am in the middle of building a model to help my sportsbetting, but I have a problem.

    I have 2 colums with home team goals and away teams goals, each row representing a match: the first match finished 4-1, the second 4-0 ect., look like this:

    Home Away
    4 1
    4 0
    6 2
    3 1
    3 0
    0 3
    2 0
    ect.

    What i could like to calculate is betting option called both to score/not to score.

    Both to score Not to score

    Under the both to score, I would like excel to calculate in how many matches both scored, ie >= 1 for both teams.

    For the not to score option, I would like excel to calculate in how many matches only 1 team scored.

    I can't seem to find a solution for this.

    Any help is appriciated.

    Thanks in advance.
    Last edited by Melgaard; 03-19-2010 at 08:30 AM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Countif - 2 criterias

    Given use of XL2007

    Both to Score

    =COUNTIFS(A:A;">0";B:B;">0")

    Not to Score

    =SUM(COUNTIFS(A:A;{">0"\"0"};B:B;{0\">0"}))

  3. #3
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,477

    Re: Countif - 2 criterias

    what about 0-0?
    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Countif - 2 criterias

    Thanks a lot sir. Didn't think it would that easy

    Thanks again, really appriciate it

  5. #5
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Countif - 2 criterias

    Ah. Yes 0-0 doesn't seem to be recognised. It should be counted under "not to score". Anyone?

  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Countif - 2 criterias

    If you need to include 0-0 also then you could add the third combination to the inline arrays - ie n-0, 0-n, 0-0

    =SUM(COUNTIFS(A:A;{">0"\0\0};B:B;{0\">0"\0}))

  7. #7
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Countif - 2 criterias

    Works now. Thanks a lot sir

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.2.0