I have a table in Excel which tracks details about projects (project number, name, program, etc.). I want to create a helper column to sort the project number column in this table (by the number, rather than alphabetically). I want to create this helper table in another sheet, and start by referencing the column in the table I want to sort AllData[ProjectNum]. I then copy this reference column into a row of my helper table called NumCopy so I can sort it (given the reference is immutable). The second column in the table called Order contains the formula:
=VALUE(TRIM(MID(V2, 9, LEN(V2))))
This extracts only the number part. However, when I try to sort Order by smallest to largest, nothing changes (sometimes it sorts for a second then immediately reverts to alphabetical). This column is of type number, and I have tried "Text to Columns" already. This is what my helper column looks like so far:
Any help would be much appreciated.
Presumably your columns contain formulas referring to the other table. Sorting the columns does not flatten these references. If you have sheet2!a1 pointing at sheet1!a1, sorting won't move it. The formula in sheet 2 will still resolve to the same location in sheet1, which is why the sorting seems to apply for a second before recalculating.
The only practical way to do this would be to copy/paste special values those columns to replace the formulas with a copy of the data, then you can sort it. You can either sort the original data, or sort a copy of the data, you can't sort a 'view' of the data, because it's linked to the original sort.
OK so there is technically a way with vba, but it's messy and would need to be rerun everytime the data changes, so wouldn't save much time.