# Returning a value that meet multiple criteria

#### jdangle

##### New Member
I have a two part question. I've been using a SUMPRODUCT equation to count the number of issues that meet multiple criterias.

ex) =SUMPRODUCT(--(Status = "Open"),--(Name = "John"))

Is there an equation that will do basically the same thing (look through a database to find if something meets multiple criteria) but will return a cell value in that same row rather than counting it? Basically, if status is "open" (C2) and name is "John" (B2), it will return the value in cell called Item (A2)?

ex)
A B C
Item Name Status
145A John Open
146A John Closed
147A Ryan Open

(so equation should only return 145A)

Part II is based on the result of the first question. Since SUMPRODUCT continues through the entire database to count all items meeting criteria, is there a way to return all the values (that meet the criteria) in a single cell? So instead of the equation giving me one value (the sumproduct) it will have every "Item" that is "open" and done by "John" in that cell.

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

##### MrExcel MVP
search the board for multi key lookup - post back if you can't get it sorted.

edit: though given the desire to return multiple values, an advanced filter is probably what you need:
Book1
ABCDEFG
1NameStatusCode
2JohnOpenaTRUE
3JohnClosedb
4JohnPendingCodeNameStatusCode
5FrankOpendJohnOpena
6FrankClosedeJohnOpenf
7JohnOpenf
Sheet5

criteria range in yellow, criteria is:

=AND(A2="John",B2="Open")

with copy to another location option...

#### jdangle

##### New Member
Im having trouble getting this equation sorted. Does anybody else have an idea how to work this equation?

##### MrExcel MVP
"Im having trouble getting this equation sorted"

"Does anybody else have an idea how to work this equation?"

Once you've provided the info, no doubt some one else will be more than willing to help out.

Replies
22
Views
303
Replies
4
Views
341
Replies
3
Views
728
Replies
3
Views
150
Replies
1
Views
212