+ Reply to Thread
Results 1 to 5 of 5

Lookup value across a row and then countif

  1. #1
    Registered User
    Join Date
    09-26-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Lookup value across a row and then countif

    Hi there. I'm new the forum. Tried searching for my question but didn't have much luck and to be honest I'm not even sure how to word this properly so bare with me.

    I'm using Excel 2010 to do this btw.

    The first worksheet is as follows:
    Column A = Employee
    Column B = Department name
    Column C = Active (either Yes or No)

    Then in the second worksheet, what I'm trying to do is count the number of active employees for each department based on the info in the first worksheet.

    What I have so far is a half-baked solution where I create Column D and use formula
    CONCATENATE(B1,"-",C1).

    Then in the second worksheet I can count the total number of active employees based on how many of those results in Column D are "Dept-YES". This works, but it seems like a work around that I should be able to get around.

    I've tried working out the logic by paper but just can't seem to translate it into Excel using formulas. Any ideas?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Lookup value across a row and then countif

    Hi,

    I think you should be able to use COUNTIFS or a pivot table to achieve what you want.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Lookup value across a row and then countif

    Hi joesmalls

    Welcome to the Forum ...

    Sounds like you're looking for COUNTIFS()

    See this workbook
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Valued Forum Contributor
    Join Date
    05-23-2011
    Location
    Lahore PK
    MS-Off Ver
    Excel 2007, 2013
    Posts
    627

    Re: Lookup value across a row and then countif

    pivot, sumproduct, countif all could do this

    see attatchmentAttachment 122614
    Attached Files Attached Files
    Azam
    If you want to say Thank you to a member, click the reputation icon (Star) in the left bottom of the post.
    For prompt answer, be descriptive, concise, short, direct, and to-the-point.

  5. #5
    Registered User
    Join Date
    09-26-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Lookup value across a row and then countif

    All solutions here worked. Just wanted to mention that I was leaning in the direction of COUNTIF but wasn't sure how to enter multiple criteria. I did run into COUNTIFS when searching but I wasn't sure how to use it so I continued googling without much luck. But it makes more sense now especially being able to look at 2 examples.

    And SUMPRODUCT is a new function to me but seems rather handy.

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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