How to get multi-row sort/filtering headers in excel
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Track title: CC C Schuberts Piano Sonata No 13 D
--
Chapters
00:00 How To Get Multi-Row Sort/Filtering Headers In Excel
00:30 Accepted Answer Score 22
01:03 Answer 2 Score 8
01:34 Answer 3 Score 4
01:55 Answer 4 Score 2
02:33 Answer 5 Score 2
03:46 Thank you
--
Full question
https://superuser.com/questions/62758/ho...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#microsoftexcel #microsoftoffice
#avk47
ACCEPTED ANSWER
Score 22
No. Omit the first row from your range when you auto filter. This way the auto filter buttons appear only on your bottom header row and the data gets filtered. I expect that right now your second header row is getting pulled into your 'data'.
You can't select a single cell and have excel figure this out. You have to select the range of cells you want excel to include.
ANSWER 2
Score 8
An easy way to accomplish the sort function using multiple header rows is to insert a blank row just above the row you want to sort by (ideally, it is bottom-most in your header. If not, make it so.). Then click on the 'row' number highlighting the empty row. Right click that row and select "Hide'. The new, empty row will vanish leaving your header the way you wanted it to look and Excel will interpret your category row as the header.
ANSWER 3
Score 4
If you select an entire row (by selecting the row number to the left of the row) and then enable your filter (Data > Filter) then it will give you filters for everything below the selected row and ignore everything above it.
ANSWER 4
Score 2
Okay, the following works in Excel 2010, even after saving the file back as an Excel 2007 and re-opening (so presumably works in Excel 2007 as well...)
Assuming a 3 row header. Set the spreadsheet filter range to Start at cell $A$4 and ensure that it covers the full extent of data you want to sort. SAVE THE FILE.
Henceforth, any sort will treat rows 1 to 3 as headers and therefore sort from row 4 onwards only. - UNLESS you change or cancel the filter range....
ANSWER 5
Score 2
Is there a way to make Excel treat the first two rows as headers?
Yes there is, if you can make one small change to the first header column.
If you are able to merge cells A1
and A2
using "Merge & Center", then Excel will properly identify both rows as header rows.
For example:
Doing an auto-sort on this will automatically (and improperly) select the second row:
But now merge A1
and A2
together:
...and Excel will now properly ignore both header rows when auto-selecting the sort area:
Exceptions:
This obviously won't work if your first column requires both lines for headers, unless you're willing to live with one merged cell with two separate lines of text. While this will look fine, it's isn't semantically correct and could lead to problems in extreme edge cases if one assumes they are separate lines.
This also won't work if A1
is merged horizontally with B1
, etc. There is no way around this problem unless you add a dummy column as the first column. If you can't do that, you will have to manually select all the data prior to sorting.
Note: all phone numbers were randomly generated with the formula below. Any similarity to an existing and valid number is purely coincidence.
=REPLACE(REPLACE(RANDBETWEEN(1000000000,9999999999),4,0,"-"),8,0,"-")