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

329

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.

People are also looking for solutions to the problem: php time between 2 dates Y-m

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.