Can Excel's INDEX function return array?

后端 未结 4 1469
死守一世寂寞
死守一世寂寞 2020-12-03 04:05

If the data in the range A1:A4 is as follows:

Apple
Banana
Orange
Strawberry

Then INDEX can be used to individual

4条回答
  •  萌比男神i
    2020-12-03 04:28

    Correct

    Update 3

    You should using array formula:

    For = INDEX(A1:A4,{2;3}) write = INDEX(A1:A4,ROW($A$2:$A$3))

    For using array formula, (1) select the range of cells you want return results, vertically (for example B1:B2) and then press (2) F2 and enter above formula, then (3) press Ctrl + Shift + Enter.

    Update

    Explain:

    You can controlling row_num and column_num parts of INDEX with array formulas for returning more specially wanted results.

    There is two approach to returning array formula results:

    • (I)

      1. Select the range that you want show returned results.
      2. Press F2
      3. Type your array form formula.
      4. Then Press Ctrl + Shift + Enter.

    Example:

    =INDEX($A$1:$A$4,SMALL(IF($B$2=$A$1:$A$4,ROW($A$1:$A$4)-ROW($A$1)+1),ROW($A:$A)))
    
    • (II)

      1. Enter the array form formula in first cell you want showing returned results (Then press Ctrl + Shift + Enter), then extend the formula.

    Example:

    =INDEX($A$1:$A$4,SMALL(IF($B$2=$A$1:$A$4,ROW($A$1:$A$4)-ROW($A$1)+1),ROW(A1)))
    

    Conclusion

    INDEX formula works in array form.

    You need enter row_num or column_num in an array. for this use suitable array formulas as: IF, SMALL, CHOOSE. Note that MATCH is not array form formula.

    Temporary sample file (for 30 days): book.xlsx

提交回复
热议问题