title: Reference Excel files getting filename from a cell
body: <p>I want to get values from different excel files (say, File-AAA.xlsx, File-ABC.xlsx, etc). ¿How can I reference said files without inputting manually the "ABC" part of the filename, but <strong>getting it from the current sheet instead</strong>?</p>
  
  <p><a href="https://i.stack.imgur.com/al7ES.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/al7ES.png" alt="Excel question example"></a></p>
  
  <p>In the example, from our current sheet we want to get the values of A1 and A2, from the <em>File-ABC.xlsx</em> file, and sum them. </p>
  
  <p>For instance, in B2, instead of writing:</p>
  
  <pre><code>    =SUM('\\server\path\[File-ABC.xlsx]Data'!A1:A2)
  </code></pre>
  
  <p>I would like to be able to write it as </p>
  
  <pre><code>    =SUM('\\server\path\[File-*REFERENCE TO CELL*.xlsx]Data'!A1:A2)
  </code></pre>
  
  <p>Where *REFERENCE TO CELL* is the <strong>sought text string</strong> that references the cell that contains "ABC" (A2).</p>