View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Conditional filter using array formula

=IF(ISERROR(SMALL(IF(($B$1:$B$20="Group")+($B$1:$B $20="A"),ROW($A$1:$A$20),""),ROW($A1:$A$20))),"",
INDEX($A$1:$A$20,SMALL(IF(($B$1:$B$20="Group")+($B $1:$B$20="A"),ROW($A$1:$A$20),""),ROW($A1:$A$20))) )

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Summary:
I would like to enter an equation that will return the first field
(that is true for a certain condition) from a list. Then subsequent
rows will return the next field (again according to the condition).
I can't use filters or pivots for this spread sheet.

Example:
I have a list as per:
Name Group
Bob A
Fred B
Matt B
Eric A
Dave A
Stew B
Fred A

I want to return all names that are in group A (condition: Group = A):
Name
Bob
Eric
Dave
Fred

or all names that are in group B (condition: Group = B):
Name
Fred
Matt
Stew

My original list will be edited and will need to automatically
generate the required output lists. Once there are no more fields to
return (e.g. Fred in group A) then the formaula should return blank
cells.
Thanks in advance for any help/suggestions.
Matt