Alphabetize names with a dynamic range

Stuepef

Board Regular
Joined
Oct 23, 2017
Messages
128
Office Version
  1. 2021
Platform
  1. Windows
I have a formula that makes a list of unique employee names that I am trying to alphabetize. The problem is there can be 2-50 (range A1:A50) employees within the list causing the alphabetize rank formula to count blank or 0 cells due to having a formula in that cell. Is there a way to use a dynamic range formula to not include the cells that contain 0 or blanks? So would it be possible to have the COUNTIF dynamically rank A1:A10 since A11:A50 are blank?

Current formula in B1:
Code:
=COUNTIF($A$1:$A$50,"<="&A1)

Desired Result:
Employee nameAlphabetize rank
GRAY,BOBBY F3
PARK,AMY G7
JOHNSON,BONNIE5
HARTFORD,ERIN Q4
STEEL,ASHLEY8
DOWEL,LOUIS1
WORD,LARRY F9
DUNCAN,HARRY W2
YOUNG,RICK R10
KNIGHT,MELISSA R6

<tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hello,

Why don't you modify your initial formula which creates the Unique Names ... to also sort the results alphabetically ...

Say your initial list is located in A2:A50 ... you could use in cell B2 the following Array Formula :


Code:
=INDEX(yourlist,MATCH(0,countif(yourlist,"<"&yourlist)-sum(countif(yourlist,B$1:B1))

Hope this will help
 
Upvote 0
@James006 - The formula results in #N/A error.
Code:
{=INDEX($A$2:$A$11,MATCH(0,COUNTIF($A$2:$A$11,"<="&A2)-SUM(COUNTIF($A$2:$A$11,B$1:B1))))}
 
Upvote 0
Sorry ...

But just tested it ... and it works fine ...

We do agree this is an Array Formula ...

Instead of the Enter key ... use simultaneously the three keys : Control Shift Enter

Code:
=IFERROR(INDEX($A$2:$A$11,MATCH(0,COUNTIF($A$2:$A$11,"<"&$A$2:$A$11)-SUM(COUNTIF($A$2:$A$11,B$1:B1)),0)),"")
 
Upvote 0
@James006 - the formula works great for the range A2:A11, but the true range is A2:A50. This is causing the issue as the formula is trying to rank the cells that have formulas in them, but no names. Thats why I was trying to figure out a way to use a dynamic range that only uses cells with names in them. The desired formula would use range A2:A50, but only rank A2:A11 since they have names populated in the cells.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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