+ Reply to Thread
Results 1 to 11 of 11

Countif 1 column value is bigger than others

  1. #1
    Registered User
    Join Date
    12-15-2013
    Location
    With your sister, somewhere you wouldn't like
    MS-Off Ver
    Excel 07
    Posts
    5

    Countif 1 column value is bigger than others

    I have data in columns, some are blank. I've been searching this forum and the help files but the syntax escapes me. the outcome seems so very simple.

    Bob
    Bob Roy Ted Eve
    12 11 9 15
    15 12
    9 13 5
    25 3 15
    15 15 15 15
    9 12 9
    10 9 8
    10 9 11

    Effectively these are quiz scores and I want to count how many times each person wins. This formula "=COUNTIF(A2:A40, ">"&B2:B40)" is the only one I've found that returns a non-error, but the results are just wrong.

    I also want to record the specific head-to-head of Bob and Roy. Effectively Countif Roy>Bob and vice versa.

    Apologies for the backward noob who needs to ask.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Countif 1 column value is bigger than others

    Hi ansd welcome to the forum

    for the Bob-Roy match, use this...
    =SUMPRODUCT(--(A2:A9>B2:B9))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Countif 1 column value is bigger than others

    If you want to compare them all against each other, try this...
    1st, create a range name for each person (easily done by highlighting the entire range, select Formulas tab/Create from selection/check Top Row)
    Then create a table like this...

    A
    B
    C
    D
    E
    13
    Bob Roy Ted Eve
    14
    Bob
    5
    5
    6
    15
    Roy
    2
    5
    6
    16
    Ted
    1
    2
    4
    17
    Eve
    1
    1
    2

    Copy this down and across...
    =IF($A14=B$13,"",SUMPRODUCT(--(INDIRECT($A14)>INDIRECT(B$13))))

  4. #4
    Registered User
    Join Date
    12-15-2013
    Location
    With your sister, somewhere you wouldn't like
    MS-Off Ver
    Excel 07
    Posts
    5

    Re: Countif 1 column value is bigger than others

    Thanks, that works.

    I get the A2:A9>B2:B9 bit, but the dashes must mean something, what is it?

    Thanks for the round-robin H2H scores, but I'm really after how many times each person won that 'row', or session.
    Last edited by jdjp298; 01-31-2014 at 06:33 PM. Reason: Just seen 2nd answer

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Countif 1 column value is bigger than others

    the -- force a text number to be a number. the 1st 1 forces the conversion (but makes it negative), the 2nd 1 changes the neg to a pos

  6. #6
    Registered User
    Join Date
    12-15-2013
    Location
    With your sister, somewhere you wouldn't like
    MS-Off Ver
    Excel 07
    Posts
    5

    Re: Countif 1 column value is bigger than others

    Thanks for the explanation. Still struggling with the 1 of 4 question though. Maybe it's harder than I imagained?

  7. #7
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Countif 1 column value is bigger than others

    Quote Originally Posted by jdjp298 View Post
    Thanks for the round-robin H2H scores, but I'm really after how many times each person won that 'row', or session.
    Try something like this


    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    Bob
    Roy
    Ted
    Eve
    Bob
    Roy
    Ted
    Eve
    2
    12
    11
    9
    15
    4
    3
    2
    2
    3
    15
    12
    4
    9
    13
    5
    5
    25
    3
    15
    6
    15
    15
    15
    15
    7
    9
    12
    9
    8
    10
    9
    8
    9
    10
    9
    11


    Formula in F2 copied across
    =SUMPRODUCT(--(A$2:A$9=SUBTOTAL(4,OFFSET($A$2:$D$9,ROW($A$2:$D$9)-ROW($A$2),0,1))))

    Hope this helps

    M.
    Marcelo Branco

  8. #8
    Registered User
    Join Date
    12-15-2013
    Location
    With your sister, somewhere you wouldn't like
    MS-Off Ver
    Excel 07
    Posts
    5

    Re: Countif 1 column value is bigger than others

    Marcelo

    Thanks for the help, but it appears to count a draw as a win also. Can it be modified to be greater than, rather than greater than or equal? As it stands I have never used any of those commands before so don't really know what any of them are doing.

  9. #9
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Countif 1 column value is bigger than others

    Quote Originally Posted by jdjp298 View Post
    Marcelo

    Thanks for the help, but it appears to count a draw as a win also. Can it be modified to be greater than, rather than greater than or equal? As it stands I have never used any of those commands before so don't really know what any of them are doing.
    Maybe this...

    F2
    =SUMPRODUCT(--(A$2:A$9=SUBTOTAL(4,OFFSET($A$2:$D$9,ROW($A$2:$D$9)-ROW($A$2),0,1))),--(COUNTIF(OFFSET($A$2:$D$9,ROW($A$2:$D$9)-ROW($A$2),0,1),N(OFFSET(A$2:A$9,ROW(A$2:A$9)-ROW(A$2),0,1)))=1))

    copy across

  10. #10
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Countif 1 column value is bigger than others

    If you may fill in the blank cells with 0 you may use:

    =SUMPRODUCT(--(COUNTIF(OFFSET($A$2:$D$9,ROW($B$2:$D$9)-MIN(ROW($B$2:$D$9)),0,1),"<"&A2:A9)=3))

    array-entered to return total for Bob, then fill across three more cells.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  11. #11
    Registered User
    Join Date
    12-15-2013
    Location
    With your sister, somewhere you wouldn't like
    MS-Off Ver
    Excel 07
    Posts
    5

    Re: Countif 1 column value is bigger than others

    Terrifying. It'll take me a week to step through what's going on there unless someone can explain more simply. It works though.

+ 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. Highlight rows if value is bigger than 428 in Column (J)
    By Tmc2159 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2013, 09:57 AM
  2. Replies: 2
    Last Post: 03-14-2006, 02:04 AM
  3. COUNTIF: 2 criteria: Date Range Column & Text Column
    By MAC in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-03-2006, 05:10 PM
  4. [SOLVED] How I can print full text bigger than column, in repeat column
    By Prince in forum Excel General
    Replies: 0
    Last Post: 08-11-2005, 03:05 PM
  5. [SOLVED] Workbook Bigger and Bigger
    By Ye Yint Win in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 09:05 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