Update the sorting from high to low in column 2

Chaturvedi, Santosh 400 Reputation points
2026-09-09T12:39:26.3533333+00:00

Hello - The below folmula is working well


=SORT(

FILTER(

    HSTACK(

        '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,

        '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$F$1466:$F$2065*$I$3        ),

    ('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065<>"-")*

    (BYROW('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,LAMBDA(r,SUM(r)>0))),

    "N"

),

2,

-1

)


But

i want to sort values from "high to Low" values according to values which are in cloumn 2 (ni(⊥)) .

User's image

Please add and update eh formula above as required.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author
Jayden-P 2,680 Reputation points Independent Advisor
2026-09-09T12:50:42.85+00:00

Hi @Chaturvedi, Santosh

The original formula is already sorting Column 2 (ni(⊥)) in descending order because the last two arguments are:

2,-1

where 2 means sort by the second column and -1 means highest to lowest.

If you would like to sort by Column 1 (Δσi (⊥) [N/mm²]) instead, you only need to change one part of the formula:

2,-1

to

1,-1

This will sort the results by Column 1 from highest to lowest while keeping the corresponding values in Column 2 aligned with each row.

You can copy this one:

=SORT(
    FILTER(
        HSTACK(
            '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,
            '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$F$1466:$F$2065*$I$3
        ),
        ('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065<>"-")*
        (BYROW(
            '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,
            LAMBDA(r,SUM(r)>0)
        )),
        "N"
    ),
    1,
    -1
)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Oldest
  1. AI answer

    2026-09-09T12:39:42.8666667+00:00

    Use the same formula and keep the SORT arguments set to sort by the 2nd column in descending order.

    Updated formula:

    =SORT(
        FILTER(
            HSTACK(
                '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,
                '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$F$1466:$F$2065*$I$3
            ),
            ('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065<>"-")*
            (BYROW('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,LAMBDA(r,SUM(r)>0))),
            "N"
        ),
        2,
        -1
    )
    

    2 means Excel sorts by Column 2.

    -1 means descending order, which is high to low for numbers.

    So the formula already sorts ni(⊥) in Column 2 from highest to lowest.

    If the result is not sorting as expected, check that the values in Column 2 are stored as numbers, not text. In Excel, numbers stored as text can prevent correct numeric sorting.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Chaturvedi, Santosh 400 Reputation points
    2026-09-09T12:42:44.0766667+00:00

    I want Δσi (⊥) [N/mm2] column 1 "highest to lowest".

    User's image

    Please update this formula below

    =SORT(

    FILTER(
    
        HSTACK(
    
            '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,
    
            '[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$F$1466:$F$2065*$I$3        ),
    
        ('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065<>"-")*
    
        (BYROW('[Fatigue Assesment_as per 17949_Welded Joints.xlsm]S1'!$E$1466:$E$2065,LAMBDA(r,SUM(r)>0))),
    
        "N"
    
    ),
    
    2,
    
    -1
    

    )

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.