Forum Discussion
Trying to organize by numbers in excel
Hello, I've been searching around for a while now but I can't seem to find the answer or I'm just doing it wrong. I'm trying to sort a column I have listed like I5, I6, I7, I8, I13, I16, I17, I18 and I19 alphabetically but it organizes it like I13, I16, I17, I18, I19, I5, I6, I7, I8.
Is there anyway I can organize it like how I intend for it to be?
Thank you for your help.
1 Reply
- alannavarroIron Contributor
Makoman295 I think there might be a simple solution with lambda or dynamic arrays, here is something that I found online, it works with vba, is going to create a function called "num" that is going to create an index starting from 1 for the range you select. Attached is an example.
https://www.extendoffice.com/documents/excel/3451-excel-sort-numbers-with-text-alpha-text-prefix-suffix.htmlFunction num(rng As Range) As Integer
Dim n As Integer
For n = 1 To Len(rng)
If Mid(rng, n, 1) Like "[0-9]" Then
num = num & Mid(rng, n, 1)
End If
Next n
End Function