View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tb tb is offline
external usenet poster
 
Posts: 84
Default Excel Formula (Not Macro) For Sorting By Row

On 12/13/2017 at 2:49:34 PM GS wrote:

On 12/12/2017 at 11:05:12 PM GS wrote:

I have an excel spreadsheet with part numbers in Column A and
bin locations in Cols. B to G. I would like to find a formula
that sorts the bin locations in Cols. B-G alphabetically. The
bin locations are formatted as Text.

For instance, Cols B1 to G1 show:
22-2D 49-6A 48-1A 49-1C 49-5A

I would like to have a formula in Cols. H1 to O1 that sorts like
this: 22-2D 48-1A 49-1C 49-5A 49-6A

Can anybody help me? Thanks.

Why not use Excel's built-in Sort feature on the row[s]?


Because (I think) I would have to sort each row individually. That
would take forever.

Each row has bin numbers for a different part number, so I would
have to sort Row 1 by itself, then sort Row 2 by itself, etc. etc.

Am I perhaps missing something?


In the Sort dialog Options/Orientation, choose Left to Right!


Right but then you have to tell Excel with one of the rows is the
primary sorting key. All the other rows will be sorted based on the
primary sorting key. I need to sort each row _independently_ from any
other row.

Say I have the following bin locations in Row 1 and Row 2 (each row
represents bin locations for a different part number):
22-2D 49-6A 48-1A 49-1C 49-5A
30-1B 05-2C 25-4D 01-1A 11-5B

When I do a Custom Sort - Options - Sort left to right, I have to
specify a Sort By Row key. Let's assume that I pick Row 1 as my Sort
By Row key. The end result would be this:
22-2D 48-1A 49-1C 49-5A 49-6A
30-1B 25-4D 01-1A 11-5B 05-2C

As you can see, Row 1 was sorted correctly but Row 2 was not.

--
tb