# If-and-index-match

#### jmegarner

##### New Member
I am using the following formula and attempting to have APPROVED or BR entered into a cell.

=IF(AND(INDEX('Raw Data'!D:D, MATCH(Template!A2&"ATP-F",'Raw Data'!A:A&'Raw Data'!E:E, 0) =100%), (INDEX('Raw Data'!D:D, MATCH(Template!A2&"BR", 'Raw Data'!A:A&'Raw Data'!E:E,0) =100%))), "BR", "Approved")

I want the sheet to look at column A and E of the Raw Data tab and if a row has both the value of A2 and "ATP-F" (column E), I would like it then to check column D for % value and then I need the sheet to check the same columns but this time looking for "BR" in column E and if both return 100% value from Column D enter "BR" otherwise "Approved"

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### Roderick_E

##### Well-known Member
maybe try control+shift+enter after put in formula? (as an array)

#### jmegarner

##### New Member
maybe try control+shift+enter after put in formula? (as an array)

I did use CSE the brackets did not copy over. When I attempt to evaluate the formula I am getting #VALUE error within the AND function.

#### Marcelo Branco

##### MrExcel MVP
Wrong parentheses..

Try
=IF(AND(INDEX('Raw Data'!D\$2:D\$100, MATCH(Template!A2&"ATP-F",'Raw Data'!A\$2:A\$100&'Raw Data'!E\$2:E\$100, 0)) =100%,INDEX('Raw Data'!D\$2:D\$100, MATCH(Template!A2&"BR", 'Raw Data'!A\$2:A\$100&'Raw Data'!E\$2:E\$100,0)) =100%), "BR", "Approved")

Note: For the sake of performance avoid references to entire columns, like A:A, D:D or E:E, in array formulas. Use definite ranges like A\$2:A\$100 etc (adjust to suit)

M.

#### jmegarner

##### New Member
Thank you, Marcelo. It worked!

#### Marcelo Branco

##### MrExcel MVP
You are welcome. Thanks for the feedback.

M.

Replies
8
Views
98
Replies
2
Views
90
Replies
1
Views
123
Replies
6
Views
477
Replies
7
Views
350

1,171,829
Messages
5,877,795
Members
433,287
Latest member
amna_shahbaz

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back