php - How to use semicolon in excel formula
973
I am using PHPExcel_Worksheet and trying to fill a cell with a formula
$formula = '=SUMPRODUCT(A5:A7;D5:D7)'
$objSheet->setCellValue('D8', $formula);
But in my worksheet I have a wrong thing in the D8
D8=SUMPRODUCT(A5:A7|D5:D7)
Who knows why semicolon is changes into a vertical line and how to avoid this?
I also tried to use setCellValueExplicit
$objSheet->setCellValueExplicit('D8', $formula);
but in this case I get the right text but it is not read like formula in the sheet
Answer
Solution:
Close excel. Go to control panel and then go into Region and Language settings. Click Additional settings and find the List separator. Make sure it is not set to the pipe symbol |. You will have to restart excel if you change the list separator.