Sortby followed by what?

Scrapyard

New Member
Joined
Mar 7, 2013
Messages
16
This question is likely one someone has asked, but I couldn't find it easily. Therefore, if the answer already exists, please direct me to it.

In short, I have a sheet cataloguing individuals who sign up for an event based on first come, first served. However, due to limitations of the system we use, each individual is limited to one entry, but we want to ensure family members are included in the final tally. To determine family members, we ask families to use the same email. We have been using manual sorting functions, but there should be a means to automate this.

I used sortby to organize the arrays by date/time, but I want to ensure all the same email addresses are "nested" either vertically or horizontally for each email. For example, in the attached image, you can see that aridy@mbx.c (J2 and J4) have a value between them. I don't want to ignore that value, I just want to move J4 between them. Worse yet, take Laura@mbx.c (J18, J24, and J26). Now, I have to keep the rows together, because in the end I want to determine each member with that email (column "First").

To further clarify, I want to sortby the column not alphabetically but by each email in order grouping them together. In the attached, all aridy@mbx.c would go first (Mason and Ariana in E2 and E3 respectively), followed by all Ohora@mbx.c (Jennifer in E4 and Charles K. in E5), followed by Zende@mbx.c (Saul in E6), etc.

I cannot use pivot tables or VBA due to system limitations.

(In the attached columns are hidden and mock data is used to preserve privacy only.)

I appreciate any help you can provide.
 

Attachments

  • Annotation 2023-07-27 173334.png
    Annotation 2023-07-27 173334.png
    46 KB · Views: 6

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Have you considered using a MINIFS() column like =MINIFS(B:B,J:J,J2) and sorting on that column instead of your existing B:B?
 
Upvote 0
Hi, perhaps you can test and adapt something like this.
Book3
ABCDEFGHI
1No.DateNameEmailNo.DateNameEmail
2109:40Name 1a409:18:03Name 4b
3209:41Name 2b209:41:00Name 2b
4310:39Name 3b310:39:53Name 3b
5409:18Name 4b809:19:14Name 8e
6510:32Name 5c309:22:07Name 9a
7609:26Name 6d109:40:00Name 1a
8710:37Name 7d609:26:15Name 6d
9809:19Name 8e710:37:31Name 7d
10309:22Name 9a510:32:29Name 5c
Sheet1
Cell Formulas
RangeFormula
F2:I10F2=SORTBY(A2:D10,MINIFS($B$2:$B$10,$D$2:$D$10,$D$2:$D$10),1,$B$2:$B$10,1)
Dynamic array formulas.
 
Upvote 0
Thank you! That worked!

Quick follow-up ... is there a way to ignore 0s or empty values in a sortby? Filter?
 
Last edited:
Upvote 0
is there a way to ignore 0s or empty values in a sortby?
Something like this maybe.
Book1
ABCDEFGHI
1No.DateNameEmailNo.DateNameEmail
2109:40:00Name 1a409:18:03Name 4b
3209:41:00Name 2b209:41:00Name 2b
4300:00:00Name 3b809:19:14Name 8e
5409:18:03Name 4b909:22:07Name 9a
6510:32:29Name 5c109:40:00Name 1a
7609:26:15Name 6d609:26:15Name 6d
87Name 7d510:32:29Name 5c
9809:19:14Name 8e
10909:22:07Name 9a
Sheet1
Cell Formulas
RangeFormula
F2:I8F2=LET(SB,SORTBY(A2:D10,MINIFS($B$2:$B$10,$D$2:$D$10,$D$2:$D$10),1,$B$2:$B$10,1),FILTER(SB,INDEX(SB,0,2)>0))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,040
Members
449,092
Latest member
ikke

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