How to add nested IF function in Excel document using C# in ASP.NET Core?
Syncfusion Excel (XlsIO) library is a .NET Excel library used to create, read, and edit Excel documents. Also, converts Excel documents to PDF files.
In this article, we will explore how to add a nested IF function in an Excel document using the following code snippet.
C#
worksheet.Range["C" + row].Formula = "=IF(ISBLANK(A" + row + "), \"\", IF(OR(ISNUMBER(SEARCH(\"SMSF\", A" + row + ")), ISNUMBER(SEARCH(\"Trust\", A" + row + ")), ISNUMBER(SEARCH(\"Company\", A" + row + ")), ISNUMBER(SEARCH(\"PARTNERSHIP\", A" + row + "))), B" + row + ", \"\"))";
A complete working sample of how to add nested if function in Excel document using C# can be downloaded from here.
See Also:
Working with Formula using XlsIO
Take a moment to peruse the documentation, where you can find basic worksheet data manipulation options along with features like Conditional Formatting, worksheet calculations through Formulas, adding Charts in worksheets or workbooks, organizing and analyzing data through Tables and Pivot Tables, appending multiple records to a worksheet using Template Markers, and most importantly PDF and Image conversions with code examples.
Refer here to explore the rich set of Syncfusion Excel (XlsIO) library features.
Conclusion
I hope you enjoyed learning about how to add nested IF function in Excel document using C#?
You can refer to our ASP.NET Core XIsIO feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET Core XIsIO example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
Note:
Starting with v16.2.0.x, if you reference Syncfusion assemblies from the trial setup or the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion license key in your application to use the components without a trial message.