I have made an excel column with a formula. Now I would like to sort this column by number... Just using sort won't work, because it sorts the formula ( =if(; =abs( etc.) and not the numbers that I see. Can somebody help me with this please?
Select any cell within the range you want to sort. On the Data tab, in the Sort & Filter group, select Custom Sort. In the Custom Sort dialog box, click Options. Under Row, in the 'Sort by' drop down, select the row that you want to sort.
To sort linked data and keep formulas without changed, you can change the references in formulas to an absolute reference, then sorting the data. Therefore the data will keep the formulas even if their orders change.
The SORT function sorts the contents of a range or array. In this example, we're sorting by Region, Sales Rep, and Product individually with =SORT(A2:A17), copied across cells F2, H2, and J2. Note: This function is currently available to Microsoft 365 subscribers in Current Channel.
Yes you can sort Excel/LibreOffice cells using just formulas only.
My unsorted numbers ( or words ) are listed horizontally. e.g. B29 – G29 ( 6 numbers ). I choose 29 so that it wont be confused with the 1 used in RANK function :D
My sorted numbers shall be in cells J29-O29.
The formula for cell J29 is
=IF(RANK($B29,$B29:$G29,1)=1,$B29,IF(RANK($C29,$B29:$G29,1)=1,$C29,IF(RANK($D29,$B29:$G29,1)=1,$D29,IF(RANK($E29,$B29:$G29,1)=1,$E29,IF(RANK($F29,$B29:$G29,1)=1,$F29,IF(RANK($G29,$B29:$G29,1)=1,$G29,$Q29))))))
The formula for cell K29 is … just convert all the “=1″
into “=2″
The formula for the rest is “=3″
for L29 and so on till “=6″
for O29.
The RANK
function will rank every cell in the range. There will not be any unranked.
The last part .. ,IF(RANK($G29,$B29:$G29,1)=1,$G29,$Q29)
If there are more than one same number .. meaning there are more than one number of the same rank.. it would duplicated the previous number of the same rank.
To sort words, you need to first convert words into ASCII using the CODE
function. The RANK
function works only with numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With