ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sorting by number of characters (https://www.excelbanter.com/excel-discussion-misc-queries/263721-sorting-number-characters.html)

NicoleS

Sorting by number of characters
 
I am using Excel 2007
(thought I posted this earlier, but can't find it - even with google group
search).

I need to sort an inventory list according to the number of characters in
the item number (not by numerals).

Is this possible?

Thanks!
Nicole

MS-Exl-Learner

Sorting by number of characters
 
May be this...

=LEN(A1)

Change the A1 to your Item Number Cell.

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"NicoleS" wrote:

I am using Excel 2007
(thought I posted this earlier, but can't find it - even with google group
search).

I need to sort an inventory list according to the number of characters in
the item number (not by numerals).

Is this possible?

Thanks!
Nicole


Pete_UK

Sorting by number of characters
 
In a spare column you can put this on row 2:

=LEN(A2)

and copy down. Include this column within the sort area, and sort on
this new column.

Hope this helps.

Pete

On May 13, 5:51*pm, NicoleS wrote:
I am using Excel 2007
(thought I posted this earlier, but can't find it - even with google group
search).

I need to sort an inventory list according to the number of characters in
the item number (not by numerals).

Is this possible?

Thanks!
Nicole



bala_vb

Quote:

Originally Posted by NicoleS (Post 953418)
I am using Excel 2007
(thought I posted this earlier, but can't find it - even with google group
search).

I need to sort an inventory list according to the number of characters in
the item number (not by numerals).

Is this possible?

Thanks!
Nicole

if you are familar with vba try this

Sub SortByLength()
Range("A:A").EntireColumn.Insert

With Range("B2", Cells(Rows.Count, "B").End(xlUp)).Offset(0, -1)
.FormulaR1C1 = "=LEN(RC[1])"
.Value = .Value
End With

Range("A2", Cells(Rows.Count, "B").End(xlUp)).Sort _
Key1:=Range("B2"), Order1:=xlDescending, Header:=xlYes
Range("A:A").EntireColumn.Delete

End Sub


All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com