VBA Range Code

kipper19

Board Regular
Joined
Apr 12, 2014
Messages
92
Office Version
  1. 365
Platform
  1. Windows
Hi all,
Hoping someone can help with a VBA code to achieve this outcome, I have a spreadsheet and lets say in column C I have a list of values, in each row ie 12.55, 11.65, 13.65, 16.65, 10.65, I could have up to 100 rows of data.
I would like the code to find the highest value of all the numbers in Column C which in the example would be 16.65 and in Column D give it a score of 5, the 2nd highest rated number ie 13.65 would get 4, the 3rd 12.55 would get 3 points, the 2nd, 2 points and the 5th highest would get a score of 1, all others would get 0
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
How about the formula ?
Fill below in D1 or your first data
Excel Formula:
=IF(RANK(C1,$C$1:$C$100)<=5,6-RANK(C1,$C$1:$C$100),"")
copy this to D2:D100
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

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