+ Reply to Thread
Results 1 to 10 of 10

Using COUNTIF or VLOOKUP with 2 or more conditions?

  1. #1
    Registered User
    Join Date
    11-05-2015
    Location
    Los Angeles, CA
    MS-Off Ver
    365
    Posts
    9

    Using COUNTIF or VLOOKUP with 2 or more conditions?

    Hello! Excel beginner here.

    Is it possible to use COUNTIF or VLOOKUP with 2 or more conditions? Is there another function for this kind of thing?

    For example, I use both functions to return the frequency of a cell value from a row or tab (countif and vlookup respectively if I'm correct) like a color, and then I would like it to return the frequency of a cell value only if it also fits another condition in another column (ie. green + medium).

    Thanks!

    -David

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

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Take a look at the COUNTIFS function - it allows you to set up more than one condition for the count.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Depending on how much data you have, I'd recommend taking both conditions and create a "concatenation key" and do a single vlookup or countif off that...reason being is countifs, sumifs, etc, are actually array formulas and are compute-intensive.
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    11-05-2015
    Location
    Los Angeles, CA
    MS-Off Ver
    365
    Posts
    9

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Pete_UK: exactly what i needed, thank you so much!

    Obsessed: will keep that one for the notes, thank you!

    Tony: got what i was looking for, thanks!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Good deal. Thanks for the feedback!

  7. #7
    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,939

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Quote Originally Posted by Obsessed View Post
    Depending on how much data you have, I'd recommend taking both conditions and create a "concatenation key" and do a single vlookup or countif off that...reason being is countifs, sumifs, etc, are actually array formulas and are compute-intensive.
    Actually, the xxxxIF range of formulas are far quicker and use less resources than older-type formulas. And as for them being ARRAY formulas, I have never heard that before
    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

  8. #8
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Quote Originally Posted by FDibbins View Post
    Actually, the xxxxIF range of formulas are far quicker and use less resources than older-type formulas. And as for them being ARRAY formulas, I have never heard that before
    What do you mean "older style formulas?"

    I had read that in a book that they were entered as regular formulas, but actually calculated the same way array formulas are...All I know is If I do a concatenation key of say, "Blue:Car" rather than "Blue" and "Car" in separate fields, it calculates exponentially quicker, so I never questioned what I read as it made sense in practice from my first hand experience. Maybe I'm wrong though.

  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
    52,939

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    I was referring to sumproduct() and sum(if()) type of formulas

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using COUNTIF or VLOOKUP with 2 or more conditions?

    Quote Originally Posted by Obsessed View Post
    it calculates exponentially quicker
    There is calculation timer code here:

    http://msdn.microsoft.com/en-us/library/aa730921.aspx

+ 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. [SOLVED] Vlookup - Country conditions (Multiple conditions)
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-26-2013, 11:42 AM
  2. [SOLVED] COUNTIF, 2 conditions
    By ckk403 in forum Excel General
    Replies: 10
    Last Post: 07-24-2012, 10:21 AM
  3. COUNTIF with two conditions
    By whftherb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2008, 03:18 PM
  4. Countif with conditions
    By Mosqui in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-05-2005, 12:15 AM
  5. COUNTIF 2 conditions
    By Biff in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 PM
  6. [SOLVED] COUNTIF 2 conditions
    By Sojo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. [SOLVED] COUNTIF for 2 conditions
    By Bruce in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  8. [SOLVED] COUNTIF 2 conditions
    By Sojo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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