If you store 0.5
in a cell, and format it as a percentage, then it will appear as 50%
.... if you store 50
in a cell, and format it as a percentage, then it will appear as 5000%
that is how it should be.
If you enter 50
as a number in the MS Excel GUI, and then set the format mask manually to a percentage, you will get a displayed value of 5000%
. However, if you enter 50%
in the MS Excel GUI, then MS Excel divides the value by 100 to store 0.5
in the cell, and formats it as a percentage (two actions in one step). If you set 50%
in this way in MS Excel, and then change the format mask from percentage to number, then you will see that MS Excel has done this division for you.
PHPExcel doesn't do this (by default)... it expects you to set the correct value and the format as two separate steps. So PHPExcel expects you to store the correct value in the cell (0.5
) in the first place, when you want to format it as a percentage.... it will not magically change the value in any way, it doesn't multiply it at all.
Note that if you are using the advanced value binder (rather than the default value binder), and set the cell value to 50%
, then PHPExcel will divide by 100 and set to a percentage automatically, in the same way as the MS Excel GUI.