# Help making code more dynamic

#### oscaro94

##### New Member
Hi,

I’ve written a code for a workbook, and would like to make it more dynamic but not sure how to do that. I’ve tried a few times with INDEX and MATCH but still quite new to excel so I haven’t had any success. Basically what I want to do is from the "Scoring 4" sheet, I want to get the quartile rank associated with a specific company and metric. The underlying data is in the "data" sheet, and the calculations for quartiles are in the "quartiles" sheet. My biggest concern is the first part of the equation so just matching the metric on the first row with the value on the "data" sheet. the second part which matches the D-column with the the "quartiles" sheet I think is less of an issue but thankful for any help there as well.

Does anyone have any idea how I can fix my issue? I’ve attatched a picture showing the code currently and I’ll write it below as well.

=IFERROR(IF(Data!AI2<INDEX(Quartiles!G\$2:G\$55;MATCH(Data!D2&" Q1";Quartiles!\$E\$2:\$E\$55;0));3;IF(Data!AI2<INDEX(Quartiles!G\$2:G\$55;MATCH(Data!D2&" Q2";Quartiles!\$E\$2:\$E\$55;0));2;IF(Data!AI2<INDEX(Quartiles!G\$2:G\$55;MATCH(Data!D2&" Q3";Quartiles!\$E\$2:\$E\$55;0));1;0)));0)

Thankful for any help,

Oscar

#### Attachments

• Code.PNG
22.9 KB · Views: 9

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

Replies
6
Views
280
Replies
5
Views
81
Replies
7
Views
274
Replies
1
Views
87
Replies
2
Views
429

1,129,373
Messages
5,635,884
Members
416,886
Latest member
coreyalaurence37

### 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