Exclude some records from a SUMPRODUCT ranking formula


New Member

I have a table of SalesReps with a two ranking formulas. The resulting rankings are used on dashboards on other worksheets. The formulas rank the performance of SalesReps within each RepGroup in ASC and DESC order (so that we can report on the top performing and bottom performing reps). The ranking is based on what percentage of their sales target they have achieved.

The problem occurs for new sales reps who don't have targets. Their "Achieved" value (Orders / Target) is undefined, corrected by formula to 0%. Because their achieved is 0%, they always top the bottom-performing sales reps, which is untrue for our purposes. We'd like to suppress the ranking of all reps with no target from the bottom performing ranking (or rank them last).

Here are the formulas I am using:

OrdersThisPeriod : SUMIFS formula referencing an external database
TargetThisPeriod : SUMIFS formula referencing an external database
Achieved : =IFERROR([@OrdersThisPeriod]/[@TargetThisPeriod],0)+(RAND()/100000) <---- I've added the random number to the formula so that I am almost guaranteed a unique Achieved percentage, which keeps my Rankings clean and unique.

RankingASC : =SUMPRODUCT(--([RepGroup]=[@RepGroup]),--([@Achieved]<[Achieved]))+1
RankingDESC : =SUMPRODUCT(--([RepGroup]=[@RepGroup]),--([@Achieved]>[Achieved]))+1

If required, I can upload a sheet with the table, but I would need to anonymise the data first which would take some time.

Thanks in advance.


Board Regular
Could you adjust your IFERROR formula to insert 999,999.00 instead of zero and then adjust the SUMPRODUCT formulas to ignore 999,999.00 as follows:

RankingASC : =SUMPRODUCT(--([RepGroup]=[@RepGroup]),--([@Achieved]<[Achieved]), --([@Achieved]<>999,999))+1
RankingDESC : =SUMPRODUCT(--([RepGroup]=[@RepGroup]),--([@Achieved]>[Achieved]), --([@Achieved]<>999,999))+1

I haven't validated this with any data just trying to think it through.


New Member
It's giving me a #VALUE ! result in the Ranking formulas. Note that I had to replace the <> with < because of the addition of the small random number to the IFERROR result. But that shouldn't matter, should it?


Board Regular
I was able to get it to work with this formula and some test data.


Result = 1.25




MrExcel MVP, Moderator
For your RankingsDESC try


.. or if you want/need to stick to SUMPRODUCT for it all, try

Last edited:


New Member

Thank you both for helping. Peter, I haven't tested yours as I was able to adapt Crystalyzer's post to suit my requirements.

I did the following:
1. added a new Achieved column to my table (Achieved2), using the 999999 method as suggested
2. added a new column called NoNewRankingDESC which used the identical formula to the RankingDESC field, except that it used Achieved2 instead of Achieved. I did not have to add the [Achieved]<>999999 parameter.

I'm happy to share a sample of my table with the new columns in case it is useful to someone, but i am not able to attach files. Let me know if you'd like it and I can share it some other way.

Thanks again.


MrExcel MVP, Moderator
Peter, I haven't tested yours as I was able to adapt Crystalyzer's post to suit my requirements.
You are of course welcome to use whatever method you want, but why don't you give it a go anyway in a copy of your workbook since it doesn't require the extra column, just an adjustment to your current formula?
Last edited:


New Member
Hi Peter,

I gave it a go, but it unfortunately doesn't work in cases where OrdersThisPeriod is 0 or under. So, if a sales rep has a target of $1000, but have achieved no sales (quite possible), or even -ve sales (also possible, especially early on in the season when customers return stock that they were over-sold the previous season, but that's a story for another day!)


MrExcel MVP, Moderator
Hi Peter,

I gave it a go, but it unfortunately doesn't work in cases where OrdersThisPeriod is 0 or under.
We hadn't heard of that possibility before, but in any case, to help my understanding, I would be interested to know if are any of these RankingDESC incorrect and why? For example, should any/all of rows 7, 9 & 10 have a value rather than blank?

I have used your formula for Achieved and RankingsASC and mine for RankingsDESC.

Excel Workbook
2A 68
Rank Excluding Some


New Member
Hi Peter,
Based on your data, the following rows should have a value in RankingDESC (I've indicated the value in brackets):

Row10 (1)
This in turn will lead to ranking changes for Row3 (2) and Row2 (3)

To translate this into Business Logic, the salesperson represented by row 10 had a Sales Target of $5, and has achieved actual sales of $0. He is clearly a worse performing rep than the one in Row 3 who had a target of $7 and achieved $6.

Some videos you may like

This Week's Hot Topics