Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9691

How to reference the result of a IMPORT function as a defined name in a single cell

$
0
0

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):

  1. MyData is just in cell B10, not multiple cells.
  2. IMPORTXML(MyUrl, MyXPath) is not expanded onto the surface of the sheet.
  3. I can reference MyData just as MyData, not as SPLIT(MyData) or something.
  4. 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 as MyUrl changes.

Viewing all articles
Browse latest Browse all 9691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>