Excel Number Format

We can use FormatString property to format the display value of any Excel Cell or Range in C# with IronXL.

Using workSheet["A2"] will only select Range of the specified address. To access Cell, the First() method has to be used. However, FormatString property can be set from both Cell and Range. Therefore, the First() method can be taken out completely. More Excel number formats can be applied using the same method as the code example have shown.

You can download a file project from this link.

How to use Excel NumberFormat in C#

  1. Download C# library to use Excel number format
  2. Load existing Excel file with Load method
  3. Set FormatString property of a cell to specify number format
  4. Select range of cells and modify the FormatString property in C#
  5. Export the edited spreadsheet with SaveAs method.