# Excel 2010: One CountIf Statement searching for 2 Values in different columns

Hi Experts - Looking for a quick formula that I can use in my workbook.  I have two worksheets in my workbook.  Worksheet A contains all my raw data.  I need to pull two values from two columns from Workbook A to populate in some cells on Workbook B.   I've got some semi formula stuff that I've found so far, but to no surprise, it's not working.  Anyone know what the missing link is below?  Thanks for your help.

``````=COUNTIF('Worksheet Name'!C2:C100,"value1",!E2:E100,"value2")
``````
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
What exactly are you trying to count?
0
Commented:
If you are trying to retrieve 2 values, you will need 2 formulas. If you can post a workbook with sample data we will be able to assist.
0
Account ManagerCommented:
If you are basing your COUNTIF on multiple criteria, you may be better served using COUNTIFS. It's very similar to COUNTIF, but it searches instances where both criteria are satisfied.

Try this modification to the information you posted:

``````=COUNTIFS('Worksheet Name'!C2:C100,"value1",'Worksheet Name'!E2:E100,"value2")
``````

I also adjusted the formula by adding 'Worksheet Name' just in front of the second criteria range "E2:E100". This will make excel search the E-column in Worksheet A as opposed to Worksheet B.

Let us know if that helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
That was dead on sir!  Thank you so much!!!
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.