Google Sheets – Get Address of a Range with Formula

formulasgoogle sheets

Let's say I have a range called WidgetTypes in cells C5:M5.

I want my formula in cell A1 to return C5:M5 or $C$5:$M$5.

What formula goes into cell A1?

cell("address",WidgetTypes) returns $C$5 but I'm stuck there. I can't get the whole thing.

EDIT

I tried:

function getRangeAddress(range) {
  return range.getA1Notation();
}

and I passed in my named range, like this:

=getRangeAddress(WidgetTypes)

but I got the error:

TypeError: Cannot find function getA1Notation in object
Kitchen,Entry,Living Room,Dining Room,Breakfast Room,Master
Bedroom,Bedroom,Full Bath,Half Bath,Utility Room,Garage. (line 2).

Best Answer

There isn't a built-in function that returns the address of a named range. One alternative is to use a custom function.

The custom function should parse the cell formula to get the name of the named range then the code code could use that string to get the related range and after that you could use getA1Notation.

Related

References