Forum Discussion

JCannon2021's avatar
JCannon2021
Copper Contributor
May 25, 2021
Solved

Excel XMATCH and FILTER with PowerShell

I am trying to use the FILTER and XMATCH formulas with a PowerShell script but when I open the XLSX files, those formulas are not spilling over to the other rows and columns and have '@' in them.   

 

If I manually remove the '@' and press enter, the formulas work, spilling over and populating the other rows and columns as set.   

 

Is there something extra I have to do within my PowerShell script?  I have tried using the .Formula, .FormulaArray, and .Value() lines.

 

Any advice would be much appreciated.

2 Replies

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    You need the Formula2 property of the Range object.
    • JCannon2021's avatar
      JCannon2021
      Copper Contributor

      JKPieterse 

       

      Awesome.  Much thanks.

       

      This is working for me now :

       

      $ExcelWorksheet.Cells.Item(2,3).Formula2 = '=FILTER(...)'

Resources