I would like to ask regarding "@" 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
ThisWorkbook.Sheets("Pivot").Range("S3").Formula = "=MEDIAN(IF($L$4:$L$" & x & "=$Q3,IF($M$4:$M$" & x & "=S$2,$N$4:$N$" & x & ")))"
the excel puts "@" in IF condition and then, it doesn't return vales but returns 0, if I remove the "@" the in formula it starts working again.
=MEDIAN(IF(@$L$4:$L$190=$Q3,IF(@$M$4:$M$190=R$2,$N$4:$N$190)))
I googled but could not find explanation of someone having same issue.