Duplicates sort in order

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
I have a list of names in Column A (A3:A50)
In column B I have various numbers between 1 and 5 for each name
I am trying to sort the entire list (which changes almost daily) with all the 1's first in Col C and then list the associated name from column A in column D, then all the 2's and then 3's and so on till all the 5's at the bottom

There ins't always a set amount for each number in col B. There could be 11 #1's and 9 #2's...etc.


I tried COUNTIF, INDEX and still cannot get it right.

Thanks in advance for your help
James
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about
+Fluff 1.xlsm
ABCD
1
2Name
3Tom Pearce11Tom Pearce
4Bill Brewer31Peter Davy
5Jan Stewer52Peter Gurney
6Peter Gurney22Dan'l Whiddon
7Peter Davy13Bill Brewer
8Dan'l Whiddon24Tom Cobley
9Harry Hawke55Jan Stewer
10Tom Cobley45Harry Hawke
11
Main
Cell Formulas
RangeFormula
C3:D10C3=LET(f,FILTER(A3:B50,A3:A50<>""),INDEX(SORT(f,2),SEQUENCE(ROWS(f)),{2,1}))
Dynamic array formulas.
 
Upvote 0
Thanks...though I am getting a SPILL! error
 
Upvote 0
In that case clear all the cells in C3:D50 & re-enter the formula in C3
 
Upvote 0
Never mind. I had dragged the formula all the way down. It just stays in top cell. Thanks again.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Another problem. Can I use an IF statement on the result in col C? I try =IF(C3=1, 100,IF(C3=2,200,IF(C3=3,300,if(C3=4,400,if(C3=5,500, 0))) and it returns and "0". I then tried =IF(F3=1,TRUE,FALSE) it returns a FALSE even though F3 does equal 1.

Suggestions?
 
Upvote 0
Can you post some sample data along with expected results, as I'm not sure what you are asking.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I did determine that the numbers in Col C are not numbers. I tried a conditional format on the column that if any cell has a "1" then highlight in red and nothing highlights. Do I need an ABS type of function?
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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