-
Notifications
You must be signed in to change notification settings - Fork 287
Function prefixes
Jan Källman edited this page Jul 27, 2023
·
7 revisions
Some newer functions in Excel needs to have prefixes when added to the Formula property via EPPlus. The most common prefix is "_xlfn.". EPPlus will handle these attribute when calculating workbook that already contains these attributes (as the workbook most likely was created by Excel), but when you add your own formulas via EPPlus you need to be aware of this.
Here is an example:
sheet.Cells["A1"].Formula = "DAYS($B$1+1,H5)";
sheet.Calculate(); // this will result in a #NAME error in cell A1 when opened in Excel
The DAYS function is one of the functions that needs to have an _xlfn. prefix
sheet.Cells["A1"].Formula = "_xlfn.DAYS($B+1,H5)";
sheet.Calculate(); // this will work
We refer to Microsofts documentation on which functions that requires attributes. Here is one page that adresses this issue. A list of functions requiring prefix can be found here
EPPlus Software AB - https://epplussoftware.com
- What is new in EPPlus 5+
- Breaking Changes in EPPlus 5
- Breaking Changes in EPPlus 6
- Breaking Changes in EPPlus 7
- Breaking Changes in EPPlus 8 (beta)
- Addressing a worksheet
- Dimension/Used range
- Copying ranges/sheets
- Insert/Delete
- Filling ranges
- Sorting ranges
- Taking and skipping columns/rows
- Data validation
- Comments
- Freeze and Split Panes
- Header and Footer
- Autofit columns
- Grouping and Ungrouping Rows and Columns
- Formatting and styling
- Conditional formatting
- Using Themes
- Working with custom named table- or slicer- styles