Ranking with SUMPRODUCT to ignore blanks

Celticshadow

Active Member
Joined
Aug 16, 2010
Messages
414
Office Version
  1. 365
Platform
  1. Windows
Hi All

I am ranking data using the below formula but if a cell is blank then I would like that cell ignored and only rank cells that contain data

{=SUMPRODUCT(--($A$2:$A$10243=$A2),--(IR$2:IR$10243>IR2))+1}

The A2:A10243 is a column containing an id number for the data held in cells IR2:IR10243.

Thanks in advance.

Regards
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
EGF
NamesAgeCountryRankingExpected resultPass/Fail
Jack25CAN1If name, age, country is not blank then rank. Pass
24UKIf name is blank and age populated and country populated then no ranking. Pass
23If name and country are blank but age populated then no ranking. CorrectPass
William22If name and age is populated but country is blank then ranking should be populated in the right sequence. Fail

<tbody>
</tbody>

=IF(AND(E1<>"",F1<>""), SUMPRODUCT(--(E1=$E$1:$E$4),--(G3<$G$1:$G$4))+1,"")
 
Upvote 0
This works I believe

Code:
=IF(AND(E2<>"",F2<>"",G2<>""), SUMPRODUCT(--(E2=$E$2:$E$6),--(G2<$G$2:$G$6))+1,"")
 
Upvote 0
Thanks for the quick reply. I can confirm that the formula is working and removing the ranking if either of the blank conditions are met. However, where there is now a blank (inline with expectation) the next number is out of sequence e.g. ranking 1,2,3,4 blank (no ranking), 6. Calculation is not adjusting the numbering sequence when more than blank condition is applied. Is there a way to fix this.
 
Upvote 0
I have re-checked the conditions and the below table shows which one is not working. Have I missed something? Also apologies if the previous table was a bit confusing.

When priority is blank the ranking numbers in next line for the impact category are not adjusted.

=IF(AND(B2<>"",C2<>"",D2<>""), SUMPRODUCT(--(B2=$B$2:$B$15),--(C2<$C$2:$C$15))+1,"")

BCDEFG
ImpactVolumePriorityRankingPass/FailExpected result
Mis-reporting500Priority_11Pass1
480Priority_2PassBlank
Mis-reporting470PassBlank
460PassBlank
Mis-reporting450Priority_53Fail2
600Priority_1PassBlank
Under-reporting590Priority_21Pass1
Under-reporting580Priority_32Pass2
Under-reporting570PassBlank
Under-reporting560Priority_54Fail3
Over-reporting400Priority_11Pass1
390Priority_2PassBlank
Over-reporting370PassBlank
Over-reporting360Priority_53Fail2

<tbody>
</tbody>

****** id="cke_pastebin" style="position: absolute; top: 141px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
Mis-reporting

<tbody>
</tbody>
</body>
 
Upvote 0
Try

G2 copied down
=IF(COUNTA(B2:D2)=3,COUNTIFS(B$2:B$15,B2,B$2:B$15,"<>",C$2:C$15,">"&C2,D$2:D$15,"<>")+1,"")

Hope this helps

M.
 
Upvote 0
Thanks. The formula works really well:)

I have noticed a couple of things:
1) if two issues have the same volume and have the same impact they get the same ranking score. I don't suppose there is way to adjust for this.

2) the ranking calculation references a cell with a formula in but there is no value in the cell other then the formula. Excel things that this cell is not blank. I have seen various answers to this issue by by selecting blank cells, paste value, populate with a random value "@" and find and delete "Q". This works but is and unwanted additional step. There is also another option by going to special, formula, select text and then delete. Both options work but reduces the level of automation for the calculations.
 
Upvote 0
Try to post a data sample along with expected results illustrating scenarios 1 and 2

M.
 
Upvote 0
1) Two line items ranked are both ranked 2 and require a tie-breaker for one to be ranked 2 and the other 3

EIFHNM
Impact_calculatedImpactVolumePriorityRankingExpected result
IF('Priority category'!$I21="Mis-reporting","Mis-reporting", IF('Priority category'!$I21="Under-reporting", "Under-reporting",IF('Priority category'!$I21="Over-reporting", "Over-reporting",IF('Priority category'!$I21="Other", "Other",""))))Mis-reporting250Priority_22Ranking: 2 or 3
IF('Priority category'!$I21="Mis-reporting","Mis-reporting", IF('Priority category'!$I21="Under-reporting", "Under-reporting",IF('Priority category'!$I21="Over-reporting", "Over-reporting",IF('Priority category'!$I21="Other", "Other",""))))Mis-reporting250Priority_22Ranking: 2 or 3
IF('Priority category'!$I21="Mis-reporting","Mis-reporting", IF('Priority category'!$I21="Under-reporting", "Under-reporting",IF('Priority category'!$I21="Over-reporting", "Over-reporting",IF('Priority category'!$I21="Other", "Other",""))))Mis-reporting300Priority_21Ranking: 1

<tbody>
</tbody>

2) If the field impacted calculation is blank (not returned a value from "I" impacted) but the cell still contain the formula and excel things that the cell is not blank

EIFHNM
Impact_calculatedImpactVolumePriorityRankingExpected result
IF('Priority category'!$I21="Mis-reporting","Mis-reporting", IF('Priority category'!$I21="Under-reporting", "Under-reporting",IF('Priority category'!$I21="Over-reporting", "Over-reporting",IF('Priority category'!$I21="Other", "Other",""))))400Priority_12No ranking

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,598
Members
449,089
Latest member
Motoracer88

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