aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
163 stars 31 forks source link

How to write a formula #41

Closed s-alexsan closed 11 months ago

s-alexsan commented 11 months ago

I have a model that have a formula '=PROCV(E4;'EFETIVO ATUALIZADO'!$B:$D;2;FALSO)' In the library I was using this way $fomulaTest = "=PROCV(RC[-1];'EFETIVO ATUALIZADO'!\$B:\$D;2;FALSO)";

And don't work, how to write a formula in this case?

aVadim483 commented 11 months ago

I think PROCV is the name of the function in Portuguese. You can use the original English function names without any problems. But if you use names in some other language, then the library must detect this language. It tries to do this automatically, but sometimes it does it wrong. Then you need to specify the locale explicitly:

$excel = Excel::create();
$excel->setLocale('pt');

But you need use version 4.8 or higher