Reversing a list in Excel within a formula

前端 未结 4 779
刺人心
刺人心 2020-12-16 06:55

So there are a bunch of ways to reverse a list to turn it into a new list, using helper columns. I\'ve written some code that does use helper columns to reverse a list and t

4条回答
  •  盖世英雄少女心
    2020-12-16 07:19

    This will do what you are asking:

    =SUMPRODUCT(INDEX(A:A,N(IF(1,{3;2;1}))),B1:B3)
    

    To make a little more dynamic you can use this array formula:

    =SUM(INDEX(A:A,N(IF(1,LARGE(ROW(A1:A3),ROW(A1:A3)))))*B1:B3)
    

    Being an array formula, it needs to be confirmed with Ctrl-Shift-Enter, instead of Enter when exiting Edit mode.

提交回复
热议问题