Hi,
Enter this formula in cell D2
=SORTBY(A2:B5,B2:B5,1,A2:A5,-1)
Hope this helps.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have an Excel file that has lots of rows with some rows largely repeats of other rows. I have a high-priority column I sort the file on, let's call it "job cancel date," and then I have another column of interest, say "site address." I want to be able to sort the file on "job cancel date" primarily, with most recent (ie, largest) first, and then if there are other rows later on in the file that have the same "site address" as a row with a larger "job cancel date" I want those rows to be located immediately under the first row having that "site address" with the larger "job cancel date," with those later rows (having the same "site address") arranged by "job cancel date" under the first row having that "site address." How can I do that?
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi,
You should always post some data (in a format the can be pasted in an MS Excel file) and show the expected result. Anyways, use the SORT()/SORTBY() function.
Hi Ashish,
I don't know how to do any of what you're saying. All I know how to do is this:
... and it doesn't do what I want.
Here's some data ...
| cancel date | site address |
|---|---|
| 11/25/2022 | A |
| 11/25/2022 | B |
| 11/25/2022 | C |
| 10/23/2022 | A |
What I want to have happen is for the sort of this entire table to be primarily by cancel date, as shown, and then if there exists another site address that matches a more recent cancel date site address for that to be right under the latest one, like this...
| cancel date | site address |
|---|---|
| 11/25/2022 | A |
| 10/23/2022 | A |
| 11/25/2022 | B |
| 11/25/2022 | C |
Ashish,
I appreciate that you have probably given me the answer. However, the actual file I'm "working" with is massive, with many upon many columns and thousands of rows, being drawn from another worksheet by formulae that I haven't a clue how to interact with. I was hoping there was a solution that wouldn't involve modifying the file at all.
Thanks.
You are welcome. The standard sort operation (shown your screenshot earlier) should work fine