Forum Discussion
nalinkodithuwakku
Sep 23, 2024Copper Contributor
Excel Dynamic Formula
I added a formula to a cell using EPPLus C# as below. mySheet.Cells[rowNumber, columnNumber].CreateArrayFormula"UNIQUE(FILTER({sheetName}!C:C,{sheetName}!B:B = A{rowNumber}))")); When I open the ge...
nalinkodithuwakku
Sep 23, 2024Copper Contributor
thanks for your response.
I tried with regular formula as well and then it comes with an additional @ sign which I need to delete manually to get the data populated.
Here is my code
var firstColumnFormula = $"UNIQUE({tailNumber}!B{firstDataRow}:B{lastDataRow})";
calculatedDataSheet.Cells[currentRow, currentCol].Formula = firstColumnFormula;
and output is
=@UNIQUE(N175QS!B15:B599)
SergeiBaklan
Sep 23, 2024Diamond Contributor
Try to use .Formula2 instead of .Formula. The latest assumes single value returned, thus implicit intersection operator ("@") is added.