Hlookup with ranking conversion

ibesmond

New Member
Joined
Nov 26, 2010
Messages
17
I'm looking for help developing a formula that will return the results...

1st, 2nd, 3rd, 4th, etc 51st, etc.

DateNameDepartmentTO VarianceCC!CC2CC35-24.9925-49.9950-199.99200-399.99400 or moreYTD
02/27/15BillBARBar Manager (99.95)6th$50.00-$199.999360018
02/27/15SamBARBar Manager (11.07)15th$5.00-$24.9915210018
02/28/15AprilBARBar Manager (9.76)8th$5.00-$24.99801009
02/28/15ScottCHEFOutlet Manager 14.0010th$5.00-$24.9910120013
02/28/15RandySERVERFood Manager (14.00)3rd$5.00-$24.99310004
02/28/15SarahSERVERFood Manager 17.002nd$5.00-$24.99201003
02/28/15Glenn
BARBar Manager (5.01)26th$5.00-$24.99268132251
02/28/15Larry
BARBar Manager 106.0028th$50.00-$199.994114282287

<tbody>
</tbody>

Date, Name and Variance are input cells.
Department and TO are Vlookups. I just created a formula for CC3 which is: =IF(E2="","",VLOOKUP(ABS(E2),$P$2:$Q$8,2,TRUE)). It looks up the variance and determines which range to return.

I wanted to create a formula for CC2 which I assume would use a Hlookup (The Column headers -
5-24.9925-49.9950-199.99200-399.99400 or more

<tbody>
</tbody>

Then lookup the corresponding amount in the table. EG. The first example is between 50-199.99. The table states it to be 6 as the result. Then the formula would convert the 6 to 6th.

I found a couple formula's that I think might be able to be combined with an hlookup but I'm not sure.

Where A1 would be the number to be converted into a ranking.
=A1&
IF(AND(MOD(A1,10)<4,OR(A1<10,A1>13)),MID("thstndrd",1+MOD(A1,10)*2,2),"th")

Thank you for taking the time to read.
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
So I figured out a working formula. Thank you for the views.

I had to add a reference for the hlookup to change the formula for each row. And add the $ signs and .00 to get the hlookup to match the lookup value.

=IF($E2="","",(HLOOKUP($H2,$I$1:$N$31,$O2,FALSE))&IF(AND(MOD((HLOOKUP($H2,$I$1:$N$31,$O2,FALSE)),10)<4,OR((HLOOKUP($H2,$I$1:$N$31,$O2,FALSE))<10,(HLOOKUP($H2,$I$1:$N$31,$O2,FALSE))>13)),MID("thstndrd",1+MOD((HLOOKUP($H2,$I$1:$N$31,$O2,FALSE)),10)*2,2),"th"))

Hope you find it useful.
 
Upvote 0

Forum statistics

Threads
1,218,219
Messages
6,141,224
Members
450,343
Latest member
patrickkw

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