where data is the named range B5:D10. Note: In Excel 365, the syntax is slightly different, see below.
First cell
To get the first cell in the range, we use this formula: The ROW function returns the first row number associated with the range, 5 and the COLUMN function returns the first column number associated with the range, 2. With abs_num set to 4 (relative), ADDRESS returns the text “B5”. Note: actually, ROW and COLUMN are returning multiple results, but in Legacy Excel, implicit intersection causes just the first result to used, which works well in the formula. In Excel 365 however, all values are returned and we need to take an extra step to get only the first value. See below.
Last cell
To get the last cell in the range, we use this formula: See this page for a detailed explanation. Essentially, we follow the same idea as above, adding simple math to calculate the last row and last column of the range, which are fed as before into ADDRESS with abs_num set to 4. This reduces to the following expression, which returns the text “D10”: Both results are concatenated with a colon in between to get a final range address as text:
Excel 365 fix
In Excel 365, which works with arrays natively, the syntax of this formula needs to be adjusted with the implicit intersection operator (@) like this: In the formula above, we use implicit intersection to stop the ROW and COLUMN function from returning multiple results for the full range. The @ operator causes ROWS and COLUMNS to return just the first result for the array.
More elegant formula in Excel 365
New array functions in Excel 365 make it possible to solve the problem with a more elegant formula like this: Here, the LET function is used assign intermediate results to the variable a. Working from the inside out, the ADDRESS function builds an array containing all cell references for all cells in the range or array: This result is assigned to the variable a. Next, the TAKE function is used to get the first and last address from a: The two address are concatenated with a colon in between to get the final result.
Named range from another cell
To get an address for a named range in another cell, you’ll need to use the INDIRECT function. For example, to get the address of a name in A1, you would use: Set abs_num to 4 inside ADDRESS to get a relative address.
- Actually, in all cases where we use ROW and COLUMN with a multi-cell named range, we’ll get back an array of numbers instead of a single value. However, since we aren’t using an array formula, processing is limited to the first item in these arrays.
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.