# 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?

x
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?
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.
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

Experts Exchange Solution brought to you by