下の実現イメージのように、セルにユーザー定義の書式を設定する場合は、該当セルのCellFormatのFormatStringに書式を指定してください。
実現イメージ

コード例
// C#(WPF、Windows Forms、等、.NET系のExcelライブラリーを使用する場合)
WorksheetCell cell;
cell = worksheet.GetCell("A1");
cell.Value = 1000;
cell.CellFormat.FormatString = "#,##0;[Red]▲#,##0";
cell = worksheet.GetCell("A2");
cell.Value = -1000;
cell.CellFormat.FormatString = "#,##0;[Red]▲#,##0";
// Javascript(Ignite UI for jQueryの$.ig.excelライブラリー)の場合
var cell;
cell = worksheet.getCell("A1");
cell.value(1000);
cell.cellFormat().formatString("#,##0;[Red]▲#,##0");
cell = worksheet.getCell("A2");
cell.value(-1000);
cell.cellFormat().formatString("#,##0;[Red]▲#,##0");
サンプル
APIリファレンス
- WPF
- WinForms
- Ignite UI for jQuery
その他参考情報
- Number format codes