Forum Discussion
Looking to rank close data sets
- Mar 03, 2023
First off if you will create hard criteria like that I would recommend a lookup table like min Val, points and then you can use that table in the formula below instead of 'hard coding' the values into the formula. It will make tweaking those cut-off values much easier. But conceptually here is the idea.
If you want a 'helper' column to show/display the points you can use something like:
=Xlookup(B1:B6, {0, 22, 22.5}, {1, 2, 3}, 0, -1)
if you will stick with the 1,2,3 point then you could use =Xmatch(B1:B6, {0,22,22.5},-1)
you can also just use that inside a calculation like
=SUM( Xlookup(B1:B6, {0, 22, 22.5}, {1, 2, 3}, 0, -1) )
and again I would recommend using a table instead of these hard coded values so if the table is in G2:G4 for min values and H2:H4 for points then it would be:
=Xlookup(B1:B6, $G$2:$G$4, $H$2:$H$4, 0, -1)
or even better yet use the 'format as a Table' option on the home menu and call that table pts and then:
=XLOOKUP(B1:B6, Pts[Min Val], Pts[Points], 0,-1)
I will attach example file
x>22.5 = 3 points
22.49>x>22.00 = 2 points
21.99>x = 1 point
Is that enough context to create a formula?
First off if you will create hard criteria like that I would recommend a lookup table like min Val, points and then you can use that table in the formula below instead of 'hard coding' the values into the formula. It will make tweaking those cut-off values much easier. But conceptually here is the idea.
If you want a 'helper' column to show/display the points you can use something like:
=Xlookup(B1:B6, {0, 22, 22.5}, {1, 2, 3}, 0, -1)
if you will stick with the 1,2,3 point then you could use =Xmatch(B1:B6, {0,22,22.5},-1)
you can also just use that inside a calculation like
=SUM( Xlookup(B1:B6, {0, 22, 22.5}, {1, 2, 3}, 0, -1) )
and again I would recommend using a table instead of these hard coded values so if the table is in G2:G4 for min values and H2:H4 for points then it would be:
=Xlookup(B1:B6, $G$2:$G$4, $H$2:$H$4, 0, -1)
or even better yet use the 'format as a Table' option on the home menu and call that table pts and then:
=XLOOKUP(B1:B6, Pts[Min Val], Pts[Points], 0,-1)
I will attach example file
- DuncanPrayMar 06, 2023Copper ContributorThanks so much for your help! This was exactly what I was looking to do. Using a "Pts" table saved me a lot of time.