When the formula is copied down, it returns an name for each column, based on index values in column H. This range goes into INDEX for the array argument, with the index value supplied from column H: The result is the name of the first item in the header, which is “ID”. Although the headers are in a horizontal array, with values in columns, INDEX will use the row number as a generic INDEX for one-dimensional arrays like this and correctly return the value at that position.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.