diff --git a/ClosedXML_Examples/Misc/Formulas.cs b/ClosedXML_Examples/Misc/Formulas.cs index 8707e4c..56a337b 100644 --- a/ClosedXML_Examples/Misc/Formulas.cs +++ b/ClosedXML_Examples/Misc/Formulas.cs @@ -1,46 +1,11 @@ -using System; -using ClosedXML.Excel; - +using ClosedXML.Excel; +using System; namespace ClosedXML_Examples.Misc { public class Formulas : IXLExample { - #region Variables - - // Public - - // Private - - - #endregion - - #region Properties - - // Public - - // Private - - // Override - - - #endregion - - #region Events - - // Public - - // Private - - // Override - - - #endregion - - #region Methods - - // Public - public void Create(String filePath) + public virtual void Create(String filePath) { var wb = new XLWorkbook(); var ws = wb.Worksheets.Add("Formulas"); @@ -83,7 +48,7 @@ // Setting the formula of a range var rngData = ws.Range(2, 1, 4, 7); - rngData.LastColumn().FormulaR1C1 = "=IF(RC[-3]=RC[-1],\"Yes\", \"No\")"; + rngData.LastColumn().FormulaR1C1 = "=IF(RC[-4]=RC[-1],\"Yes\", \"No\")"; // Using an array formula: // Just put the formula between curly braces @@ -109,12 +74,5 @@ wb.SaveAs(filePath); } - - // Private - - // Override - - - #endregion } } diff --git a/ClosedXML_Tests/Resource/Examples/Misc/Formulas.xlsx b/ClosedXML_Tests/Resource/Examples/Misc/Formulas.xlsx index 3a48083..7f8080e 100644 --- a/ClosedXML_Tests/Resource/Examples/Misc/Formulas.xlsx +++ b/ClosedXML_Tests/Resource/Examples/Misc/Formulas.xlsx Binary files differ