You are here: Help Topics > Customization > Calculation > Example for CGROUP and TOTAL Functions

Example for CGROUP and TOTAL Functions

You can use the TOTAL and CGROUP counting parameter to get a count of cells or non-zero cells in a total or cgroup range.

For example, say you have a cell group, abc, as follows:

c100 = 100

c101 = 0

c102 = 100

c103 = 100

c104 = 0

c105 = 100

Cgroup count including zeros

cgroup("abc",0) = 6

Cgroup count not including zero values

cgroup("abc",1) = 4

The TOTAL function takes an additional optional parameter to allow counting of cells in a total

Total count including zeros

TOTAL(c100..c105,1,0) = 6

Total count not including zero values

TOTAL(c100..c105,1,1) = 4

Therefore, to calculate the average of a range of cells, where zero values would be included, you could enter:

TOTAL(c100..c105) .

TOTAL(c100..c105,1,0) OR

CGROUP("abc") .

CGROUP("abc",0)