How to Fix Curly Braces and Missing Results in EPPlus Dynamic Array Formulas
Question details
The user is experiencing an issue where dynamic array formulas (like UNIQUE and FILTER) written using EPPlus appear with curly braces, and the full array results are missing.

- Product
- Excel / EPPlus
- Device & OS
- not provided
- Scenario
- Generating an Excel workbook programmatically using the EPPlus library and inserting dynamic array formulas.
- Observed behavior
- Formulas are wrapped in curly braces and only return the first element instead of spilling the results, requiring manual editing to work properly.
Ensure you are opening the generated workbook in a modern version of a spreadsheet application (such as Excel 365, Excel 2021, or WPS Office) that natively supports dynamic array spilling.
Write the Formula as a Regular Worksheet Formula
Avoid using the legacy CreateArrayFormula method, which produces outdated CSE (Ctrl+Shift+Enter) array formulas instead of modern dynamic arrays.
When you use the CreateArrayFormula method in EPPlus, it mimics the legacy Ctrl+Shift+Enter behavior. This forces the formula to be wrapped in curly braces {} and prevents modern dynamic array functions like UNIQUE and FILTER from automatically spilling across neighboring cells.
To resolve this, you must assign the formula directly to the cell's Formula property as a standard formula. Modern spreadsheet engines will automatically recognize it as a dynamic array and spill the results accordingly.
Open your C# project and locate the line in your EPPlus code where you are applying the dynamic formula using the CreateArrayFormula() method.
Replace the legacy array method with a direct string assignment to the Formula property. For example, use: worksheet.Cells["A1"].Formula = "UNIQUE(FILTER(A2:A10, B2:B10>0))";
Save your code, rebuild the application, and generate the Excel workbook again.
Open the newly generated .xlsx file. The curly braces should be gone, and the formula should naturally spill its results into the adjacent cells.

View and Edit Dynamic Array Spreadsheets with WPS Office
If you are generating Excel files with dynamic array formulas like UNIQUE and FILTER, WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Excel for testing, viewing, and editing your workbooks.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install and launch the application: Follow the installation prompts and open WPS Spreadsheet.
- 3. Open your generated file: Drag and drop your EPPlus-generated .xlsx file into WPS Spreadsheet to instantly verify your dynamic array formulas.

Frequently Asked Questions
Why do my Excel formulas have curly braces around them?
Curly braces {} indicate a legacy CSE (Ctrl+Shift+Enter) array formula. These were used in older versions of Excel to handle calculations processing multiple values, before dynamic arrays were introduced.
Does EPPlus support dynamic array formulas?
Yes, EPPlus supports modern dynamic array formulas. However, you must write them as standard formulas using the cell's .Formula property rather than the older CreateArrayFormula method, which is specifically designed for legacy CSE arrays.
Why is my dynamic array formula only showing the first result?
If a dynamic array formula is mistakenly entered as a legacy array formula, it will not spill over into adjacent cells. It becomes restricted to the specific cell or range it was explicitly assigned to, resulting in only the first item being displayed.




