I'm storing mix of numeric and non-numeric values in a single column in spreadsheet using C# and EPPlus. When I open spreadsheet with Excel it shows green triangles in the cells with numeric values giving warning that 'Number Stored as Text' and giving option to ignore it for particular cell. Can I do it from code or is it some Excel specific feature?
You really have 2 options using code:
change the .NumberFormat property of Range to TEXT (I believe equivalent in epplus is Cell[row, column].Style.NumberFormat.Format
)
prefix any number with '
(a single quote) - Excel then treats the number as TEXT - visually, it displays the number as is but the formula will show the single quote.
Alternatively, which I wouldn't recommend relying on