Ndenge Gerald

Ndenge Gerald

  • NA
  • 5
  • 611

creating excel program with C#

Jun 25 2020 12:51 PM
I have something like the code below and want to calculate the the mean for the parameter 'value' in column d, using  a calculatemean() method that returns a value to the sheet. 
 
please how can i go about it? 
  1. static void AddPropertyToWorksheet(float size,string suburb,string city, float value)  
  2. {  
  3. int row = 2;  
  4. Excel.Worksheet Property_info = workbook.Worksheets[1];  
  5. while (true)  
  6. {  
  7. if (Property_info.Cells[row, "A"].Value == null)  
  8. {  
  9. Property_info.Cells[row, "A"] = size;  
  10. Property_info.Cells[row, "B"] = suburb;  
  11. Property_info.Cells[row, "C"] = city;  
  12. Property_info.Cells[row, "D"] = value;  
  13. return; 
 

Answers (1)