COUNTIF function to rank names marks different names the same rank

fufkin

New Member
Joined
Jan 20, 2020
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
Hello. Please help, as I'm losing the will to live!
I have a list of unique peoples names starting in cell B5 to B20, which I want to rank so that I can sort alphabetically. I have a count of names in cell B4.
I've tried several formulas and I get the same result each time. Excel ranks 2 different names the same number.
I've tried the following formulae:

In A5 I have:
=COUNTIF(OFFSET($B$5,0,0,$B$4,1),"<"&B5)

In D5 I have:
=IF(B5<>"",SUMPRODUCT((B5>=OFFSET($B$5,0,0,$B$4,1))+0),"")

I've attached a screenshot of the result. I've obfuscated part of the names for obvious reasons.
 

Attachments

  • Excel_Problem.png
    Excel_Problem.png
    11.8 KB · Views: 13
Hi Fluff,

Bingo! Yes I do and it is what is causing the problem. I use it to count the number of unique entries. The formula is =SUMPRODUCT((PEOPLE <>"")/COUNTIF(PEOPLE ,PEOPLE ))

I'm not sure where that formula came from, online search somewhere.

I will try to find an alternative.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Fluff,
Yes I do. The function is =SUMPRODUCT((Employees<>"")/COUNTIF(Employees,Employees & ""))
If I manually type the answer then the list works as expected.
So I guessed that maybe that function isn't outputting an integer, so I rewrote it to =INT(SUMPRODUCT((Employees<>"")/COUNTIF(Employees,Employees & "")))

And BINGO!!! everything works as expected.

Thank you for your help, it is very much appreciated.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,844
Messages
6,127,252
Members
449,372
Latest member
charlottedv

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