This project has moved. For the latest updates, please go here.

Add formula to cell

Mar 22, 2011 at 3:45 PM

I'm trying to add the following formula to a cell:

ws.Cells["D5"].Formula = "COUNTIF(A1:A100,\"Miss\")";

This formula works great in excel when I add it manually.  However, when i try to add it using the above line of code, the cell in the output file is always empty.  Is it possible to add this type of function to an excel sheet?  If so, how?

 

 

 

Coordinator
Mar 22, 2011 at 4:29 PM

This works fine when I try it with the latest source and Excel 2007.

What version are you using?

Mar 22, 2011 at 4:32 PM

I’m using the trunk from epplus-74444 and excel 2010. However, I did some more research on the discussions and using CreateArrayFormula works.

From: jankallman [email removed]
Sent: Tuesday, March 22, 2011 11:30 AM
To: Hammond, Greg
Subject: Re: Add formula to cell [EPPlus:250690]

From: jankallman

This works fine when I try it with the latest source and Excel 2007.

What version are you using?