+ Reply to Thread
Results 1 to 6 of 6

COUNTIF value in column A is <, =, or < corresponding value in same row, column B

  1. #1
    Registered User
    Join Date
    03-21-2017
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2013
    Posts
    9

    COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    With regards to an annual test, I have the most recent test scores in column A and the previous scores in column B. I want to count the number of individuals who's scores have improved, the number who have stayed the same, and the number who have worsened.

    I have been using the COUNTIF function as follows:

    Attempt 1:
    =COUNTIF(A2:A100,">"&B2:B100)

    This gives a result of 0 despite many occurrences of A values being greater than their corresponding B values.

    Attempt 2:
    =COUNTIF(A2:A100,">"&B2)
    This seems to give me the number of A values that are greater than B2 specifically, as if I had written it $B$2, instead of the B value in the same row.

    I thought perhaps maybe the gaps in Data were causing my issues (i.e. I don't have scores for every individual on the list as some of them have not taken the test yet, or did not take the test last year) So I tried entering all vacant scores as 0 but this did not solve any issues.

    If anyone could provide some insight into how to properly return the data I am looking for it would be much appreciated!! Thank you!
    Last edited by KDSearle; 03-21-2017 at 04:43 PM. Reason: Solved

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    Use these formulas entered as array formulas. That is, instead of just typing them in and hitting ENTER, hit CTRL+SHIFT+ENTER.

    =SUM(IF($A$2:$A$100>$B$2:$B$100,1,0))
    =SUM(IF($A$2:$A$100=$B$2:$B$100,1,0))
    =SUM(IF($A$2:$A$100<$B$2:$B$100,1,0))

    You will know the array is active when you see curly braces { } appear around your formula. You cannot type in the braces, but you will see them in the formula bar.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    Or, normal formulae:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    03-21-2017
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2013
    Posts
    9

    Re: COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    Thank you both soo much!!

  5. #5
    Registered User
    Join Date
    03-21-2017
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2013
    Posts
    9

    Re: COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    Thanks! This worked perfectly! I have never had to use Arrays before, I will have to do some research!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: COUNTIF value in column A is <, =, or < corresponding value in same row, column B

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Replies: 7
    Last Post: 04-01-2016, 03:27 PM
  2. [SOLVED] Sumproduct and Countif in column A and need to sum quantity in column F
    By drewship in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2016, 03:54 PM
  3. Replies: 3
    Last Post: 01-07-2015, 03:55 AM
  4. 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
  5. How do I Excel countif column a =? and column b = null ?
    By tiff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-30-2005, 08:35 AM
  6. Replies: 0
    Last Post: 03-09-2005, 06:47 AM
  7. Using COUNTIF to count column entries if adjacent column contains data
    By johnfullerroot in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-09-2005, 05:43 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