title: EPPlus - How to set data type of a column to General
body: <p>In my <code>ASP.NET Core 1.1</code> app I'm using <a href="https://github.com/VahidN/EPPlus.Core" rel="nofollow noreferrer">EPPlus.Core</a> to export data to Excel. Some columns exported have mostly numbers but rarely a text (e.g. <code>N/A</code>). These columns in generated Excel are showing (as expected) a <code>green triangle</code> on the top left corner of their cells. I want to get rid of those warnings.</p>
  
  <p><strong>Question</strong>: What's a good way of getting rid of those triangles when Excel is generated? I tried setting the format of these columns to text as follows but it did not work. I guess we need to set the format of these columns to <code>General</code> but I can't figure out how:</p>
  
  <pre><code>workSheet.Cells["D1:P1"].Style.Numberformat.Format = "General";
  </code></pre>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Per a user's request, the code looks similar to following.</p>
  
  <ol>
  <li>Error at inner loop <code>for (var j = 4; j &lt; testlist[i].Count(); j++){...}</code>: MyViewModel does not contain a definition of Count()</li>
  <li>Error at line <code>if (testlist[i][j] is string){...}</code>: cannot apply indexing with [] to an extension of type MyViewModel</li>
  </ol>
  
  <p><strong>Controller</strong>:</p>
  
  <pre><code>....
  ....
  var testlist = (qry to load a MyViewModel).ToList();
  
  using (ExcelPackage pkg= new ExcelPackage())
  {
       var ws = excel.Workbook.Worksheets.Add("TestWorkSheet");
       ws.Cells[1, 1].LoadFromCollection(rc_excel, true);   
  
      //I'm starting from 2nd row and 5th column
       for (var i = 1; i &lt; testlist.Count; i++)
       {
          for (var j = 4; j &lt; testlist[i].Count(); j++)
          {
            if (testlist[i][j] is string)
            {
               ....
               ....
            }
      }
    pkg.Save();
  
    return(....);
  }
  </code></pre>