title: Why does excel put @ in formula from VBA code?
body: <p>I would like to ask regarding &quot;@&quot; in excel formulas, I have written formula below that calculated median based on certain conditions. The formula works when I write it manually directly in cells, but every time I try to populate the formula by VBA code below</p>
  <pre><code>ThisWorkbook.Sheets(&quot;Pivot&quot;).Range(&quot;S3&quot;).Formula = &quot;=MEDIAN(IF($L$4:$L$&quot; &amp; x &amp; &quot;=$Q3,IF($M$4:$M$&quot; &amp; x &amp; &quot;=S$2,$N$4:$N$&quot; &amp; x &amp; &quot;)))&quot;
  </code></pre>
  <p>the excel puts &quot;@&quot; in IF condition and then, it doesn't return vales but returns 0, if I remove the &quot;@&quot; the in formula it starts working again.</p>
  <pre><code>=MEDIAN(IF(@$L$4:$L$190=$Q3,IF(@$M$4:$M$190=R$2,$N$4:$N$190)))
  </code></pre>
  <p>I googled but could not find explanation of someone having same issue.</p>