Ranking by certain criteria

SwanB

New Member
Joined
Aug 31, 2023
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi! I am hoping to get some help on a ranking formula. What I am trying to do is rank a column (GXT). If the Category Column has "Including" then give that line the same rank number that falls within that same interval (From m) (To m) columns. Example:
View attachment 99994

If it does not have an "Including" then it just gives it the next rank. There will be numerous sites within this spreadsheet. It would be nice to have each year be ranked, so 2022 will have a rank starting with 1 to whatever and then 2023 will start over with rank 1 through ending on whatever date. The intervals (From m) and (To m) columns might over lap with other sites but if we could match with the Hole column and site columns that should keep things separated.

If there is a different/better way to do this, I am all for it.

I have attached a small spreadsheet. I hope this makes sense.

Thank you for your time!

Test for SI Rank.xlsx
ABCDEFGHIJKLMNOP
1RegionConcatenateSiteDateProjectHoleCategoryFrom (m)To (m)Int (m)TW (m)Column1Column2GXTCommentsRank
2NAKA18KA1/31/2022awesome35495.3507.512.274.8714
3NAKA19KA1/31/2022awesome35Including501.45064.672.542
4NAKA7KA1/31/2022awesome3545.751.86.122.5883
5NAKA8KA1/31/2022awesome35Including48.850.31.520.985
6NAKA16KA1/31/2022awesome35486.2492.36.112.7551
7NAKA17KA1/31/2022awesome35Including487.7490.7310.902
8NAKA21KA1/31/2022awesome35530.4547.116.78.5838
9NAKA12KA1/31/2022awesome35234.7259.124.48.3692
10NAKA13KA1/31/2022awesome35Including240.8242.31.52.211
11NAKA20KA1/31/2022awesome35510.5527.316.86.3336
12NAKA9KA1/31/2022awesome35129.5138.79.25.6764
13NAAK10KA1/31/2022awesome35Including135.6137.21.62.2496
14NAKA5KA1/31/2022awesome3524.4327.65.2136
15NAKA6KA1/31/2022awesome35Including24.425.91.52.16
16NAKA14KA1/31/2022awesome35274.3278.94.63.7858
17NAKA1KA1/31/2022awesome26286.5292.66.13.1354
18NAKA2KA1/31/2022awesome26Including291.1292.61.51.9545
19NAKA22KA1/31/2022awesome35534.9536.51.62.8528
20NAKA23KA1/31/2022awesome35550.2554.74.52.6235
21NAKA3KA1/31/2022awesome289.116.87.72.1098
22NAKA4KA1/31/2022awesome28Including9.110.71.61.3712
23NAKA15KA1/31/2022awesome35458.7463.34.61.104
24NAKA11KA1/31/2022awesome35182.9187.54.61.104
25NAKA27KA2/28/2022great353.3617.79.009
26NAKA28KA2/28/2022great3Including57.9613.16.696
27NAKA199KA1/31/2023awesome55Including100.6123.422.811.484.018
28NAKA145KA1/31/2023awesome58Including483.11484.631.5271.44
29NAKA180KA1/31/2023awesome58472.4490.718.31460.2
30NAKA230KA1/31/2023awesome58472.4490.718.31460.2
31NAKA182KA1/31/2023awesome58Including483.1484.61.51.151.711
32NAKA232KA1/31/2023awesome58Including483.1484.61.51.151.711
33NAKA136KA1/31/2023awesome55Including349350.521.5246.968
34NAKA152KA1/31/2023Dis25Including18.327.49.11.7829.014
35NAKA186KA1/31/2023Dis2510.727.416.721.877
36NAKA127KA1/31/2023Dis25Including18.2927.439.1416.2692
37NAKA188KA1/31/2023Dis25Including18.327.49.116.198
38NAMB1MB1/31/2022close6222.90024229.51446.614163.492236569
39NAMB2MB1/31/2022close6713.994739.444825.4508485.5957143
40NAMB3MB1/31/2022close6Including716.82864731.824814.99616450.4452215
41NAMB4MB2/28/2022close6479.1456483.71764.5729.56190215
42NAMB5MB2/28/2022close6503.5296508.10164.5721.08159221
43NAMB6MB3/31/2022close6No SI623.316633.06969.75360
44NAMB7MB3/31/2022close6No SI654.4056680.008825.60320
45NAMB8MB3/31/2022close6689.1528749.80860.6552475.1847362
46NAMB9MB3/31/2022close6715.2132739.444824.2316466.15527
47NAMB10MB3/31/2022close7No SI0
48NAMB11MB4/30/2022close7No SI0
49NAMB12MB5/31/2022close7750.4176762.609612.1928.025727706
50NAMB13MB5/31/2022close7776.3256794.308817.983211.83794837
51NAMB14MB5/31/2022close7816.5877.861.347.34199
52NAMB15MB5/31/2022close7Including822828.16.117.80895
53NAMB16MB5/31/2022close7908.994738.17.43712
Sheet 1
Cell Formulas
RangeFormula
J2:J26J2=[@[To (m)]]-[@[From (m)]]
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If it does not have an "Including" then it just gives it the next rank
To achieve this we mandatory need to have data sorted by date in ascending order, else whatever formula we will populate would give error (I'm forgetting the name of it)

If we can sort the data then I have to think of second thing that is ranking should start fresh every year but that can be done (probably) - for that I will work with your sample data once you agree to sorting...

Please revert
 
Upvote 0
To achieve this we mandatory need to have data sorted by date in ascending order, else whatever formula we will populate would give error (I'm forgetting the name of it)

If we can sort the data then I have to think of second thing that is ranking should start fresh every year but that can be done (probably) - for that I will work with your sample data once you agree to sorting...

Please revert
If that is the way you think we need to do it then lets try that.
thanks
 
Upvote 0
Check below and revert.

Note:
# There is a challenge with your sample data every time there is "including" in Column G, it repeats some value from above. That's fine. But first of them should not carry "including" for Excel to understand from where it needs to copy. Check test Column R for understanding. Hope rest of the needs it fullfills. Error in Data you need to rectify as per your need

# The solution existed on following link. I just improvised - Rank if formula

Book1
ABCDEFGHIJKLMNOPQR
1RegionConcatenateSiteDateProjectHoleCategoryFrom (m)To (m) Int (m) TW (m)Column1Column2GXTCommentsYearRankTest
2NAKA18KA44592awesome35495.3507.512.2074.871420224 
3NAKA19KA44592awesome35Including501.45064.6072.5422022NF0
4NAKA7KA44592awesome3545.751.86.1022.588320226 
5NAKA8KA44592awesome35Including48.850.31.5020.9852022NF0
6NAKA16KA44592awesome35486.2492.36.1012.755120227 
7NAKA17KA44592awesome35Including487.7490.73.0010.9022022NF0
8NAKA21KA44592awesome35530.4547.116.708.5838202211 
9NAKA12KA44592awesome35234.7259.124.408.3692202212 
10NAKA13KA44592awesome35Including240.8242.31.502.2112022NF0
11NAKA20KA44592awesome35510.5527.316.806.3336202215 
12NAKA9KA44592awesome35129.5138.79.205.6764202216 
13NAAK10KA44592awesome35Including135.6137.21.602.24962022NF0
14NAKA5KA44592awesome3524.4327.605.2136202217 
15NAKA6KA44592awesome35Including24.425.91.502.162022NF0
16NAKA14KA44592awesome35274.3278.94.603.7858202218 
17NAKA1KA44592awesome26286.5292.66.103.1354202220 
18NAKA2KA44592awesome26Including291.1292.61.501.95452022NF0
19NAKA22KA44592awesome35534.9536.51.602.8528202221 
20NAKA23KA44592awesome35550.2554.74.502.6235202222 
21NAKA3KA44592awesome289.116.87.702.1098202223 
22NAKA4KA44592awesome28Including9.110.71.601.37122022NF0
23NAKA15KA44592awesome35458.7463.34.601.104202224 
24NAKA11KA44592awesome35182.9187.54.601.104202225 
25NAMB1MB44592close6222.90024229.51446.613.492236569202219 
26NAMB2MB44592close6713.994739.444825.45485.595714320221 
27NAMB3MB44592close6Including716.82864731.824815.00450.44522152022NF0
28NAKA27KA44620great353.3617.709.009202210 
29NAKA28KA44620great3Including57.9613.106.6962022NF0
30NAMB4MB44620close6479.1456483.71764.579.5619021520229 
31NAMB5MB44620close6503.5296508.10164.571.08159221202226 
32NAMB6MB44651close6No SI623.316633.06969.750202227 
33NAMB7MB44651close6No SI654.4056680.008825.600202227 
34NAMB8MB44651close6689.1528749.80860.66475.184736220222 
35NAMB9MB44651close6715.2132739.444824.23466.1552720223 
36NAMB10MB44651close7No SI0202227 
37NAMB11MB44681close7No SI0202227 
38NAMB12MB44712close7750.4176762.609612.198.025727706202213 
39NAMB13MB44712close7776.3256794.308817.9811.8379483720228 
40NAMB14MB44712close7816.5877.861.3047.3419920225 
41NAMB15MB44712close7Including822828.16.1017.808952022NF0
42NAMB16MB44712close7908.994738.107.43712202214 
43NAKA199KA44957awesome55Including100.6123.422.8011.484.0182023NF0
44NAKA145KA44957awesome58Including483.11484.631.5271.442023NF0
45NAKA180KA44957awesome58472.4490.718.301460.220231 
46NAKA230KA44957awesome58472.4490.718.301460.220231 
47NAKA182KA44957awesome58Including483.1484.61.501.151.7112023NF0
48NAKA232KA44957awesome58Including483.1484.61.501.151.7112023NF0
49NAKA136KA44957awesome55Including349350.521.5246.9682023NF0
50NAKA152KA44957Dis25Including18.327.49.101.7829.0142023NF0
51NAKA186KA44957Dis2510.727.416.7021.87720233 
52NAKA127KA44957Dis25Including18.2927.439.1416.26922023NF0
53NAKA188KA44957Dis25Including18.327.49.1016.1982023NF0
Sheet1
Cell Formulas
RangeFormula
P2:P53P2=YEAR(D2)
Q2:Q53Q2=IFS(G2="including",XLOOKUP(1,($J$1:J1=J2)*($P$1:P1=P2),$Q$1:Q1,"NF"),TRUE, COUNTIFS($P$2:$P$53,P2,$G$2:$G$53,"<>including",$N$2:$N$53,">"&N2)+1)
R2:R53R2=IFS(Q2="NF",COUNTIFS($J$1:J1,J2,$G$1:G1,"<>"&"including"),TRUE,"")
J2:J35J2=I2-H2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
Q:QExpression=AND(R1<>"Test",R1<>"",R1>=1)textNO
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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