public string Formula() { string formula = ""; int offset = Coefficients.GetLowerBound(0) - VariableNames.GetLowerBound(0); for (int i = Coefficients.GetLowerBound(0); i < Coefficients.GetUpperBound(0); i++) { formula += "(" + Coefficients[i].ToString("0.0000") + " * " + ExcelHelpers.CreateValidFormulaName(VariableNames[i - offset]) + ") + "; // formula += "(" + Coefficients[i].ToString() + " * " + ExcelHelpers.CreateValidFormulaName(VariableNames[i - offset]) + ") + "; } formula += Coefficients[Coefficients.GetUpperBound(0)].ToString("0.00"); return(formula); }