Improve formula example
This commit is contained in:
@@ -50,9 +50,16 @@ int main()
|
|||||||
//![1]
|
//![1]
|
||||||
|
|
||||||
//![2]
|
//![2]
|
||||||
for (int row=22; row<=30; ++row)
|
xlsx.addWorksheet("ArrayFormula");
|
||||||
xlsx.write(row, 1, 100.0 - row);
|
Worksheet *sheet = xlsx.currentWorksheet();
|
||||||
xlsx.currentWorksheet()->writeArrayFormula("B22:B30", "{=A22:A30*10}");
|
|
||||||
|
for (int row=2; row<20; ++row) {
|
||||||
|
sheet->write(row, 2, QString(row%5+1, 'X')); //B2:B19
|
||||||
|
sheet->write(row, 3, QString(row%5+1, 'X')); //C2:C19
|
||||||
|
sheet->write(row, 5, 100.0 - row); //E2:E19
|
||||||
|
}
|
||||||
|
sheet->writeArrayFormula("C20", "{=SUM(IF((C2:C19=\"X\")*(B2:B19=\"X\"),1,0))}");
|
||||||
|
sheet->writeArrayFormula("F2:F19", "{=E2:E19*10}");
|
||||||
//![2]
|
//![2]
|
||||||
|
|
||||||
//![3]
|
//![3]
|
||||||
|
|||||||
Reference in New Issue
Block a user