Help making code more dynamic

oscaro94

New Member
Joined
Nov 25, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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
    Code.PNG
    22.9 KB · Views: 9

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,127,194
Messages
5,623,303
Members
415,965
Latest member
Sixaside

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top