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, 10 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
-
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
1 hour, 34 minutes ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
2 hours, 53 minutes ago -
Is your battery draining?
by
Susan Bradley
2 hours, 18 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
4 hours, 50 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
5 hours, 26 minutes ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
8 hours, 41 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
11 hours, 37 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 hour, 55 minutes ago -
National scam day
by
Susan Bradley
4 hours, 51 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 hours, 6 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
1 day, 6 hours ago -
Tools to support internet discussions
by
Kathy Stevens
1 day, 13 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
21 hours, 35 minutes ago -
AI is good sometimes
by
Susan Bradley
1 day, 13 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
1 day, 3 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 13 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
2 days, 12 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 16 hours ago -
Excessive security alerts
by
WSSebastian42
1 day, 7 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
3 days, 2 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
19 hours, 10 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days, 13 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
1 day, 6 hours ago -
OS news from WWDC 2025
by
Will Fastie
16 hours, 53 minutes ago -
Need help with graphics…
by
WSBatBytes
1 day, 21 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
3 days, 17 hours ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 16 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 days, 19 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
4 days, 4 hours ago -
Search Forums only bring up my posts?
by
Deo
9 hours, 9 minutes 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.