addFunction

addFunction

BASIC / ADVANCED / PREMIUM

Adds functions into the Excel spreadsheet.

Description
public addFunction($function, $position, $contentStyles = array(), $cellStyles = array(), $options = array())

This method allows adding a function into a position.

Parameters

function

Function beginning with '='.

position

Cell position in the active sheet: A1, C3, AB7...

contentStyles

Check addCell to see all available options.

cellStyles

Check addCell to see all available options.

options

Check addCell to see all available options.

Code samples

Example #1

The resulting XLSX looks like:

Example #2

The resulting XLSX looks like:

Release notes
  • phpxlsx 1.0: new method.