Note: The motivation for my question is just formula readability. My sheet is working fine.
Let's pretend I have an IMPORTXML
function that's currently returning 2 columns and a varying number of rows depending on the url used. So the expression is IMPORTXML(MyUrl, MyXPath)
.
So the way I'm using that expression right now is INDEX(IMPORTXML(MyUrl, MyXPath),1,4)
and this is repeated many times with just different row values. This is working fine, and in order for this to work it's not necessary for there to be a range on the sheet showing the results.
I would rather not repeat that expression IMPORTXML(MyUrl, MyXPath)
many times over and over in my formulas, but give that expression a name and just use that name instead, in order to make my formulas more readable. So I want to say INDEX(MyData,1,4)
.
Let's say MyData
is in cell B10. What formula needs to go into B10?
Constraints (and yes these are integral to the question):
MyData
is just in cell B10, not multiple cells.IMPORTXML(MyUrl, MyXPath)
is not expanded onto the surface of the sheet.- I can reference
MyData
just asMyData
, not asSPLIT(MyData)
or something. - I can't just stick
IMPORTXML(MyUrl, MyXPath)
somewhere and highlight the data and define a range name. Because the size of it will vary asMyUrl
changes.