Looking to Shorten Code

dandj

New Member
Joined
May 16, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey all!

I was curious if there was any way to shorten this code. I want to be able to look at three columns (TYPE1, TYPE2, etc.) and essentially, in a "rank" order, have the value in the original cell be the one that first is shown in the column.

Here is what I am working with so far (and works, but don't feel like redoing everything):

1684269300381.png

Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Welcome. You'll get more help (or any) if you use XL2BB to show a sample of your worksheet and expected results.
 
Upvote 0
See if the following formula works for you:
Excel Formula:
=INDEX(Types,4-MOD(MAX((TYPE1=Items)*(Ranks+3),(TYPE2=Items)*(Ranks+2),(TYPE3=Items)*(Ranks+1)),10))
where
- Items is named range with your "Au", "FUCH", "FELD", ... , "CAL"
- Ranks is a named range with 80, 70, 60, ... , 10
- Types is a named range with "TYPE1", TYPE2", "TYPE3", =""
 
Upvote 0

Forum statistics

Threads
1,226,118
Messages
6,189,070
Members
453,524
Latest member
AshJames

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
Back
Top