Sort while keeping information together

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
165
Office Version
  1. 365
Platform
  1. Windows
Looking to sort the information but it needs to stay within the relevant group. It doesn't matter what order the Unit is in ie it could be Sales first, then Finance and it doesn't matter if the Staff names are not in order so Tom can come before Jack for example. They key thing is that the information is consolidated properly. Required output is in Cols D & E. It would be handy that once it's in the format in columns D & E that if the Unit is moved around that the individual names follow the Unit.

Book4
ABCDE
1UnitStaffUnitStaff
2HRTomHRTom
3JanJan
4Finance FredVirgil
5SarahBert
6SalesJackFinanceFred
7KenSarah
8HRVirgilSalesJack
9BertKen
10SalesTedTed
11PeterPeter
Sheet1
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
It would be much easier if you populated the blank cells in the Unit column with the appropriate Unit value.
Then sorting becomes very easy.

You can populate those values very quickly and simply using the method here: Fill in blanks in Excel with value above/below, fill empty cells with 0.

If you really like the look of only showing the Unit on the first entry of each section, you can easily use Conditional Formatting to make the ones appear invisible (by formatting the font color to match the white background color).
 
Upvote 0
It would be much easier if you populated the blank cells in the Unit column with the appropriate Unit value.
Then sorting becomes very easy.

You can populate those values very quickly and simply using the method here: Fill in blanks in Excel with value above/below, fill empty cells with 0.

If you really like the look of only showing the Unit on the first entry of each section, you can easily use Conditional Formatting to make the ones appear invisible (by formatting the font color to match the white background color).
Thanks Joe, like the conditional formatting tip.
 
Upvote 0

Forum statistics

Threads
1,216,732
Messages
6,132,409
Members
449,726
Latest member
Skittlebeanz

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