* * *Help with Sorting with Merged Cells* * *

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
Hello

I was wondering if it would be possible to sort a worksheet by merged cells. Here's an example of the problem:

In colunn A
I have a vertically merged cell (3 cells)
Then I have three lines next to it.

A1
A2
A3

Its like this example, except I only have one A since I have merged the three together. So how can I sort by column A. I would need the three lines next to each merged box to travel with the merged box.

So if I have

B4
B5
B6
A1
A2
A3 (again, A and B are merged into one box)

I would want it to sort to be
A1
A2
A3
B4
B5
B6

So that 4,5,6 stay with B and 1,2,3 stay with A and all move together.

Any help would be appreciated.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
First why Merged cells? the sort need the cell to be the same size. for all that is being sorted, just make your cell a biger to hold your date in one cell. on A. then sort should work for you.
 
Upvote 0
I had it as a merged cell so that it was easier to read.

So that we could see

"A" and then 3 rows next to "A" were all part of the "A" heading rather than having

"A"-Row of info
"A"-Another Row of info
"A"-Another row of info

I tried unmerging the cells so that I had
1-Info
1-Info
1-Info
2-Data
2-Data
2-Data
.
.
.
10-Stuff
10-Stuff
10-Stuff

and then sorted by first column ascending and it sorted but it gave me

1-Info
1-Info
1-Info
10-Stuff
10-Stuff
10-Stuff
2-Data
2-Data
2-Data

Any ideas on why it didn't just sort it as
1
1
1
2
2
2
.
.
.
10
10
10
 
Upvote 0
would need to know the info and the date and suff, to test it out, when you sort it will put it in order, if sam , tom . mark was in A it would sort it ot mark sam tom,
 
Upvote 0
Hi,

Excel will treat this as text:

1-Info
1-Info
1-Info
10-Stuff
10-Stuff
10-Stuff
2-Data
2-Data
2-Data

If you want Excel to sort correctly, you'll have to include a leading zero for the single digit numbers, like

01-Info
01-Info
01-Info
02-Data
02-Data
02-Data
10-Stuff
10-Stuff
10-Stuff


Teylyn
 
Upvote 0
Thanks for the replies.

I ended up just creating a custom list that was 1,1,1,2,2,2,3,3,3 etc.

Then i sorted by that to get it how I wanted.

Merging cells can be such a pain! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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