+ Reply to Thread
Results 1 to 5 of 5

[Solved] Count from 2 worksheets and multiple criteria

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Schaumburg, IL
    MS-Off Ver
    Excel 2007
    Posts
    24

    [Solved] Count from 2 worksheets and multiple criteria

    HI. I’m looking for help to count rows based on multiple criteria from 2 worksheets. The following are sample worksheets to help illustrate:


    Worksheet “Data”

    Code_Name City State
    Red1 San Jose CA
    Blue3 Los Angeles CA
    Red1 Glendale CA
    Black3 Turlock CA
    Blue3 Reno NV
    White1 Sparks NV
    Black3 Modesto CA


    Worksheet “Names”

    Code_Name Group Current
    Red1 01 Yes
    Blue3 02 Yes
    Black3 01 No
    Blue4 02 Yes
    White1 03 Yes
    Green2 03 No
    Green3 02 No

    I need to count in the “Data” worksheet the number of times code_names appear in the ‘Code_Name’ column of the “Data” worksheet that have a ‘Group’ of “01” from the ‘Group’ column of the “Names” worksheet. In this sample the count is 3.

    The ‘Code_Name’ column of the “Data” worksheet will contain duplicates which are to be included in the count. The ‘Code_Name’ column of the “Names” worksheet will not contain duplicates, and the ‘Group’ column will contain duplicates.

    The logic is something like “Count all records in the “Data” worksheet where the ‘Code_Name’ equals the ‘Code_Name’ in the “Names” worksheet that have a ‘Group’ of “01”.

    The formula I am trying to write should function such that all I need to do is change the ‘Group’ number to get a count based on that number. I.E. If I use “02” instead of “01”, I would get a count from the “Data” worksheet” of all records where the ‘Code_Name”(s) are in ‘Group’ “02”. In this sample the count would be “2”.

    Hope I made this clear, as I am very confused after searching for a solution. Thanks in advance for any help.
    Last edited by gdaniels; 06-11-2014 at 11:46 AM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Count from 2 worksheets and multiple criteria

    please send a sample workbook next time,
    Attached Files Attached Files

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Count from 2 worksheets and multiple criteria

    Find the attached sheet to see if this is what you are trying to achieve.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    02-10-2014
    Location
    Schaumburg, IL
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Count from 2 worksheets and multiple criteria

    Thanks to Sktneer. Solved the problem.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: [Solved] Count from 2 worksheets and multiple criteria

    You're welcome. Thanks for the feedback and rep.

+ 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. Count statement wtih multiple criteria only showing results for one criteria
    By uhlabomber in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2013, 02:47 PM
  2. count unique values in multiple worksheets with multiple criteria
    By craig04 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2012, 03:26 PM
  3. Sumproduct/sumif/indirect across multiple workbooks, worksheets, multiple criteria
    By robgardner15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2011, 02:35 AM
  4. Replies: 0
    Last Post: 02-26-2010, 02:20 PM
  5. Count across worksheets with two criteria
    By Billy Dixson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-01-2006, 02:50 PM

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