+ Reply to Thread
Results 1 to 9 of 9

Countif + vlookup of multiple values

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Countif + vlookup of multiple values

    Hi all,

    First time poster, long time viewer. I've been looking through the forums trying to find someone with a similar problem as mine but haven't quite nailed it on the head. I am working with an Excel 2010 workbook that has two worksheets in it. What I am trying to accomplish is I want the second worksheet to scan the first worksheet for a student's name, and count all of the instances that the student has a score less than a certain threshold (we'll say "5" for this example). I have tried using various combinations of vlookup and countif functions, but have not had much success. I did get it to a point where it worked, but only for the first instance of that student's name; it wouldn't continue searching the first worksheet for any other instances.

    I have attached a sample workbook as a reference. Any help is much appreciated; thank you.
    Attached Files Attached Files
    Last edited by seack; 01-15-2014 at 07:57 PM. Reason: attachment removed at OP's request

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,530

    Re: Countif + vlookup of multiple values

    Did you forget to attach the workbook? I can't see one in your post.

    Pete

  3. #3
    Registered User
    Join Date
    01-15-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Countif + vlookup of multiple values

    Sorry, it's attached now.

  4. #4
    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
    53,053

    Re: Countif + vlookup of multiple values

    OK wait, I just got a "report post" from you asking "Please delete this post, wrong attachment included"
    ??
    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

  5. #5
    Registered User
    Join Date
    01-15-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Countif + vlookup of multiple values

    Yes,

    Originally I included some sensitive data by accident and wasn't sure how to remove it. I have since uploaded the correct attachment (that's why you couldn't find it originally). Sorry.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,530

    Re: Countif + vlookup of multiple values

    Put this in B2 of the Performance sheet:

    =COUNTIFS('Student Data'!$A:$A,$A2,'Student Data'!$B:$B,"<5")

    and this one in C2:

    =COUNTIFS('Student Data'!$A:$A,$A2,'Student Data'!$B:$B,">=5")

    (NOTE that I have made it >=5, rather than >5). Then copy both formulae down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    01-15-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Countif + vlookup of multiple values

    Works a treat Pete, thank you. I must have been making it much more complicated than I need to. Would you mind explaining what exactly that formula is doing so I can "understand" the logic behind the equation?

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,530

    Re: Countif + vlookup of multiple values

    The COUNTIFS function is used for multiple-condition counts (COUNTIF can only be used for a single condition). In your case you have two conditions - you are interested in a particular name (in column A of the Performance sheet) AND where the score is below 5 (for column B). The syntax for COUNTIFS is that you have pairs of terms, the first relating to the range and the second relating to the condition, so to paraphrase the 1st formula that I gave you, it is saying:

    COUNT the number of entries IF the names on the Data sheet = A2 AND IF the scores on the Data sheet is less than 5

    Hope this helps.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, I would like to inform you that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  9. #9
    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
    53,053

    Re: Countif + vlookup of multiple values

    OK confusion reigned and we all got wet lol. As long as we are were we need to be now

+ 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: 5
    Last Post: 05-21-2013, 12:46 PM
  2. [SOLVED] How do i vlookup & countif across multiple sheets?
    By msalib888 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2013, 01:22 AM
  3. countif(Range, multiple referenced values?)
    By neilpateluk in forum Excel General
    Replies: 3
    Last Post: 01-08-2009, 12:29 PM
  4. COUNTIF for multiple values
    By inno101 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2008, 01:22 PM
  5. [SOLVED] Using COUNTIF to check values in multiple columns
    By DTomSimpson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2005, 12:06 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