Solved

excel formula

Posted on 2011-03-07
10
249 Views
Last Modified: 2012-05-11
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
Comment
Question by:sburgoin
  • 6
  • 2
  • 2
10 Comments
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
=COUNTIF(CMA_Report!C1:C296,AND("John Doe","Joe Harris")
0
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
=COUNTIF(CMA_Report!C1:C296,AND("John Doe","Joe Harris"))
0
 

Author Comment

by:sburgoin
Comment Utility
what if it's in a different column all together?
0
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
Was missing an ) at the end...
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
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

by:jppinto
Comment Utility
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

by:jppinto
Comment Utility
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

by:jppinto
Comment Utility
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

by:sburgoin
Comment Utility
got what I needed.  thanks!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now