Sort Matrix By Largest Value

  • Hi everyone. I encounter a problem regarding the coding of a function which is designed to sort the (n by 3) matrix by largest value e.g

    transform
    CHF EUR 0.923126
    CHF USD 0.154571
    EUR USD 0.254522



    into
    CHF EUR 0.923126
    EUR USD 0.254522
    CHF USD 0.154571


    here is my coding:


    I dont know where went wrong, i m an beginner, please help!!!!!

  • Re: Sort Matrix By Largest Value


    Try


    =sorting(A1:C2)


    as opposed to


    =sortin(A1:C2)


    You got #NAME because no such function SORTIN exists as it is SORTING

  • Re: Sort Matrix By Largest Value


    and a range "A1:C3" should be more appropriate.


    How big can became your "n" ?


    filippo

  • Re: Sort Matrix By Largest Value


    Thanks. i realize that i misspell the function name in excel. now the problem is resolved. but another problem arise. if there are two values have the same values, the function wont work properly. i just spotted that and working on solving this matter, any suggestions?

  • Re: Sort Matrix By Largest Value


    Have you tried to run your code for large "n"s? eventually try and adapt to your needs one of the common sorting algorithm like bubble sort, insert, shell, etc...


    filippo

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!