Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# excel formula

Posted on 2011-03-07
Medium Priority
255 Views
I need to create a formula in excel that provides results only if 2 criteria are met in 2 different columns.  I curently use the following formula: =COUNTIF(CMA_Report!C1:C296,"John Doe") .   what formula can I use so that both criteria oreven 3 criteria, if met, will provide me with results (an item count on a table).
0
Question by:sburgoin
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 6
• 2
• 2

LVL 33

Expert Comment

ID: 35060892
=COUNTIF(CMA_Report!C1:C296,AND("John Doe","Joe Harris")
0

LVL 33

Expert Comment

ID: 35060904
=COUNTIF(CMA_Report!C1:C296,AND("John Doe","Joe Harris"))
0

Author Comment

ID: 35060909
what if it's in a different column all together?
0

LVL 33

Expert Comment

ID: 35060911
Was missing an ) at the end...
0

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 35060923
Try COUNTIFS (with an "S"), e.g.

=COUNTIFS(CMA_Report!C1:C296,"John Doe",CMA_Report!D1:D296,4)

that would count rows where column C contains the name John Doe and column D contains a 4

regards, barry
0

LVL 50

Expert Comment

ID: 35060937
I don't believe you can use an AND like that in COUNTIF jp,

sburgoin, see my suggestion above for two criteria in two columns

barry
0

LVL 33

Expert Comment

ID: 35060954
You can use a SUMPRODUCT() function, something like this:

=SUMPRODUCT((CMA_Report!C1:C296="John Doe")*(Sheet1!D1:D296="Joe Harris")*(CMA_Report!E1:E296="Test"))

jppinto
0

LVL 33

Expert Comment

ID: 35060993
Barry is right, COUNTIF can't be used with an AND...sorry, I wasn't thinking properly. But the SUMPRODUCT can be an alternative to COUNTIFS()...
0

LVL 33

Expert Comment

ID: 35061052
What version of Excel are you using? If it's prior to Excel 2007 you don't have COUNTIFS() function, you need to do it using SUMPRODUCT() function...
0

Author Closing Comment

ID: 35061788
got what I needed.  thanks!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to usâ€¦
###### Suggested Courses
Course of the Month9 days, 22 hours left to enroll