# Retrieving lines from a dataset that match more than one criteria using array formula

#### Sztofts

##### New Member
Hi

I am having trouble getting this simple task completed. I want to retrieve the lines from the dataset which match the criteria in the criteria range as there's more than one criteria, the lines retrieved must match just one of the criteria to appear in the result.

The formula I am having trouble with is:

'=SMALL(IF(\$C\$3:\$C\$8=\$H\$11,ROW(\$B\$3:\$B\$8)-2,IF(\$C\$3:\$C\$8=\$H\$12,ROW(\$B\$3:\$B\$8)-2,IF(\$C\$3:\$C\$8,\$H\$13,ROW(\$B\$3:\$B\$8)-2))),ROW(1:1))

where
C3:C8 is the data set
H11:H13 is the criteria (three cells)

There are curly brackets around my working formula which do not appear in the formula above.

Any help greatly appreciated.

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

#### AhoyNC

##### Well-known Member
Try one of these formulas. Formula in D1 if you have Excel 2010 or later or formula in F1 which must be enter with CTRL-SHIFT-ENTER. Drag formulas down as needed.
Excel Workbook
CDEFG
2Data
3test111
4test244
5test377
6test488
7test5
8test6
9test4
10test8
11test9test1
12test4
13test8
Sheet

#### Sztofts

##### New Member
Many thanks, the formula worked first time

Replies
3
Views
78
Replies
6
Views
69
Replies
10
Views
79
Replies
4
Views
60
Replies
3
Views
203