Rank If

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
I am looking for a RankIf solution. I would prefer not to use VBA if at all possible. This is for a co-worker and I don't want to have to support it. In the example below, I have the agent and sales. I would like to create the rank column with a formula. I want to rank sales by agent. The goal is to avoid sorting or filtering. I tried an array type formula and got errors;

=rank(C3,(1*($B$3:$B$11=B3))*$C$3:$C$11), but this produced an error - The formula you typed contains errors.

Any ideas? Silly mistake? Thanks.
Book6
BCDE
2AgentSalesRank
3AA13
4AB23
5AC33
6AA42
7AB52
8AC62
9AA71
10AB81
11AC91
Sheet1
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
it won't work because your array's are trying to produce a single result. whilst the rank function needs an actual array to rank against, not just a single return.

have you checked out cpearson's ranking solutions yet?

edit: http://www.cpearson.com/excel/rank.htm
 
Upvote 0
No sorting requirement implicates pretty expensive formulas...
Book1
ABCD
2AgentSalesRank
3AA13
4AB23
5AC33
6AA42
7AB52
8AC62
9AA71
10AB81
11AC91
12
Sheet1


The formula in C3 is:

=MATCH(B3,LARGE(IF($A$3:$A$11=A3,$B$3:$B$11),ROW(INDIRECT("1:"&COUNTIF($A$3:$A$11,A3)))),0)

which must be confirmed with control+shift+enter instead of just with enter.
 
Upvote 0
Perhaps not as expensive--
MrE4194.xls
ABCDEFGH
1February:March:
2AgentSalesRankAgentSalesRankRank
3AA13AA1211
4AB23AB722
5AC33AC533
6AA42AA1211
7AB52AB1311
8AC62AC622
9AA71AA833
10AB81AB433
11AC91AC1011
Sheet3


The formula in C3 is:

=SUMPRODUCT(--(A$3:A$11=A3)*(B3< B$3:B$11))+1

I included a second set of data ("March") and copied this formula to column G. Aladin's formula is in column H.

--Tom
 
Upvote 0
rrdonutz said:
Perhaps not as expensive--...

The formula in C3 is:

=SUMPRODUCT(--(A$3:A$11=A3)*(B3< B$3:B$11))+1

I included a second set of data ("March") and copied this formula to column G. Aladin's formula is in column H.

--Tom

Watch out for -- and * together in the same formula...

=SUMPRODUCT(--(A$3:A$11=A3),--(B3< B$3:B$11))+1

It will be certainly less expensive than the MATCH formula with INDIRECT. With lots of data (huge ranges), sorting allows for performance formulas.
 
Upvote 0
Originally posted by Aladin Akyurek:
Watch out for -- and * together in the same formula...

=SUMPRODUCT(--(A$3:A$11=A3),--(B3< B$3:B$11))+1
. . .
Aladin, what is the potential problem/conflict? My apologies, as I'm sure you've probably answered this before . . .

Regards,

Tom
 
Upvote 0
rrdonutz said:
Originally posted by Aladin Akyurek:
Watch out for -- and * together in the same formula...

=SUMPRODUCT(--(A$3:A$11=A3),--(B3< B$3:B$11))+1
. . .
Aladin, what is the potential problem/conflict? My apologies, as I'm sure you've probably answered this before . . .

Regards,

Tom

Doubles coercion maybe. More importantly, it would dispose the onlooker to believe that Tom fails to understand coercion. :LOL: We would want to exclude such, don't we?
 
Upvote 0
Well there's a lot I'd like to exclude, but probably the first would be my income from the avaricious bite of the tax man :devilish: , having just given a large chunk (April 15) as well a couple of hunks of my backside to said predator. :(
 
Upvote 0
I may be the person Seti originally posted this for. I already posted 2) in another thread, but here are both questions again.


At the moment, I have two issues:

1) The Rank IF: I need to rank people by production numbers within their position (e.g. processor, closer, underwriter, etc.), but some of the names of the employees (in another column) need to be excluded (Other and Unknown). What I did to the production numbers was to say =If(Name<>"Uknown",IF(Name<>"Other",Use Total,"")) and then use the complicated ranking forumula shown before (with Large, Indirect and Match or whatever it was). This seemed to work the first time (before my specs changed) - since I didn't have any errors in the two sample exhibits I made. It would be nice to not have to make the "Modified production" column and just include the conditions in the formula (to exlcude them from that ranking).

2) Count IF and IF. Basically, count the # of employees per position excluding the "Unknown" and "Others".

Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

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