Hello,
Using Aspose.Cells v7.4.2.0.
Here is the code I am using:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
cells["A3"].PutValue("ab-c-d");
//Excel Formula
//=SEARCH("-?-?*", A3, 1) returns:3
var formula1 = @"=SEARCH(" + @"""" + "-c-d" + @"""" + ", A3, 1)";
var formula2 = @"=SEARCH(" + @"""" + "-?-?" + @"""" + ", A3, 1)";
//formula1, formula2 above basically translates to =SEARCH("-c-d",A3,1) and =SEARCH("-?-?,A3,1)
var result1 = worksheet.CalculateFormula(formula1); //returns 3
var result2 = worksheet.CalculateFormula(formula2); //should return 3, but does not. Returns value of type Aspose.Cells.ErrorType.Value
---
When I use wildcards in the SEARCH function, it does not work. I tried SEARCH("-*",A3,1), but that fails too.
My goal is to check if the value in each cell is of the format xxxxx-x-x
Any ideas or suggestions?
Thanks.