Finding Data with INDEX

Both the INDEX function and the OFFSET function return data from a subset of an array. They differ in several ways, including what it is you want to accomplish:

  • It's typical to use OFFSET when you can specify several rows and columns that you want to get at. For example, you might use this

    =OFFSET(BaseCell, 0, 0, 2, 2)
    

    to get the cells in the first two rows and the first two columns of a range of cells.

  • It's typical to use INDEX when you can specify a particular row or column and you want the value where they intersect. For example, this

    =INDEX(D4:E6, 3, 2)
    

    returns the contents of cell E6; that is, the third row of the second column of the range D4:E6. See Figure 2.4.

    Figure 2.4. Using INDEX in this way is similar to using ...

Get Managing Data with Microsoft® Excel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.