I would like to perform the following sorting: I have 30 columns, divided into 15 “groups” of 2 columns each. In the first row/column of each group, I have a name. What I would like to do is sort the 15 groups alphabetically. That is columns 1 and 2 would always be sorted as one, columns 3 and 4 as one, etc., based on the name in row one of column 1, row 1 of column 3, row 1 of column 5, etc.
Any ideas?
Thanks in advance.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
General Excel sorting question
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » General Excel sorting question
- This topic has 11 replies, 7 voices, and was last updated 14 years, 9 months ago.
AuthorTopicWSjlkirk
AskWoody LoungerMay 17, 2010 at 7:54 am #468950Viewing 7 reply threadsAuthorReplies-
WBell
AskWoody_MVPMay 17, 2010 at 8:12 am #1224123What version of Excel are you using? Most recent versions want to sort the whole worksheet, but you can specify the range that you want to sort as well. If that get’s too complext for you, try inserting a blank column between column 2 and 3, between 4 and 5, etc. Then when you click in the left column of a pair, Excel will default to sorting just the two columns.
-
WSjlkirk
AskWoody LoungerMay 17, 2010 at 12:40 pm #1224142What version of Excel are you using? Most recent versions want to sort the whole worksheet, but you can specify the range that you want to sort as well. If that get’s too complext for you, try inserting a blank column between column 2 and 3, between 4 and 5, etc. Then when you click in the left column of a pair, Excel will default to sorting just the two columns.
I have 07, and I am unclear as to your proposed solution.
Sorry
-
-
WBell
AskWoody_MVPMay 17, 2010 at 5:49 pm #1224188The Sort capabilities are on the Home Ribbon near the right hand end.
-
[*]Select the first two columns by clicking in the column headers
[*]Click the sort button on the ribbon and choose smallest to largest or largest to smallest
[*]That will sort the first two columns
[*]Now select columns 3 and 4
[*]Click Sort again and choose the order you want.
[*]Columns 3 and 4 are now2 sorted
[*]Continue this process until all 15 column pairs have been sorted -
WSjlkirk
AskWoody LoungerMay 18, 2010 at 4:56 pm #1224351The Sort capabilities are on the Home Ribbon near the right hand end.
- [*]Select the first two columns by clicking in the column headers[*]Click the sort button on the ribbon and choose smallest to largest or largest to smallest[*]That will sort the first two columns[*]Now select columns 3 and 4[*]Click Sort again and choose the order you want.[*]Columns 3 and 4 are now2 sorted[*]Continue this process until all 15 column pairs have been sorted
Here is an example of “before” and “After” of what I want. The before in on Sheet1, and after on Sheet2
-
WBell
AskWoody_MVPMay 19, 2010 at 11:38 am #1224428Here is an example of “before” and “After” of what I want. The before in on Sheet1, and after on Sheet2
You really need to be more explicit on what you are trying to do if you expect to get useful assistance from Loungers. Excel by default sorts by rows, and since you didn’t specify that you wanted to sort by columns, I assumed that was what you wanted. Furthermore, as Steve points out, your example appears to be nonsense, as you have one more set in Sheet 2 than you did in Sheet 1, and one of the Sheet 1 group (E) is gone. Frankly, if you only have 15 groups to do, it would be easiest to simply cut and paste the group of cells, as it appears you really want to sort it based on the name in the row 1 cell. Sorting by column in Excel won’t do what you want unless you put the same label in both cells, and put a 1 (or someother character) after the name in the second cell so the columns in each group retain their relative position.
-
-
-
WSsdckapr
AskWoody LoungerMay 19, 2010 at 6:29 am #1224392I don’t follow the logic in the “after” based on what you ask. Why is the E Section deleted? Why are sections B and D duplicated?
Based on the logic you describe and the setup (ignoring your after) I would:
Insert a new row2
Then in A2:
=A1
In B2:
=IF(ISBLANK(B1),A2&”Z”,B1)
Copy B2 to C2:J2
Copy Row2
Paste – special -values in row 2
Data – sort
[options ] Sort left to right[ok]
Sort on row 2
Delete row 2Steve
-
WSGCWesq
AskWoody LoungerMay 19, 2010 at 9:47 pm #1224532I don’t think you can do what you want with your current setup. You need to associate your pairs of columns somehow. An easy way would be to add a row at the top and merge the pairs of new cells in that row at the top of each pair of columns. Then add the names you want to sort by in the merged cells.
-
WSGCWesq
AskWoody LoungerMay 19, 2010 at 10:12 pm #1224536 -
WSshinerwright50
AskWoody Lounger -
WSRAK Piracicaba
AskWoody LoungerMay 20, 2010 at 11:07 pm #1224893Hmmm… All this sorting using Excel’s Sort tool seems like hard work to me, and may be difficult to remember the “how to” for future usage. I’d like to propose a different strategy – using some of Excel’s formulae! I’ve come up with a solution, which you can find in the attachment. I think some of the “work” could be done better with the use of array formulae, but it works! Data in, sorted immediately, no need to run the sorter!! I’d be interested in seeing other solutions which don’t use Excel’s sort tool.
RAK
-
WSdabbler68
AskWoody LoungerAugust 14, 2010 at 10:50 pm #1239315I came up with an alternate way to do it using code (2003)
It makes some assumptions about the data (ie only ever 5 double columns, and 11 rows each, but they could really be automated)
Forgive the messy code, I’m no expert, but it seems to work ok
It was fun to play with on a rainy Sunday arvo anyway
Viewing 7 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Teams lost all my Skype contacts (Awaiting moderation)
by
Lucy
2 hours, 6 minutes ago -
0Patch, where to begin
by
cassel23
6 hours, 2 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
9 hours, 1 minute ago -
89 million Steam account details just got leaked,
by
Alex5723
17 hours, 26 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
17 hours, 34 minutes ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
8 hours, 33 minutes ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
10 hours, 56 minutes ago -
Installer program can’t read my registry
by
Peobody
1 hour, 55 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
6 hours, 20 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
13 hours, 41 minutes ago -
False error message from eMClient
by
WSSebastian42
1 day, 4 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
1 day, 13 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
1 day, 14 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
11 hours, 35 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
1 day, 18 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
19 hours, 33 minutes ago -
Outdated Laptop
by
jdamkeene
1 day, 23 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
2 days, 5 hours ago -
Another big Microsoft layoff
by
Charlie
2 days, 5 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
2 hours, 24 minutes ago -
May 2025 updates are out
by
Susan Bradley
4 hours, 17 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
2 days, 11 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
2 days, 11 hours ago -
Drivers suggested via Windows Update
by
Tex265
2 days, 10 hours ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
7 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 days, 17 hours ago -
Apple releases 18.5
by
Susan Bradley
2 days, 12 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
2 days, 19 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
2 days, 20 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
1 day, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.