I. Overview
When making a summary report, how to dynamically sum only the values of the row where check boxes are checked?
II. The train of thought
With hidden columns, the value of the current row is determined if the current row is checked, and 0 is assigned if the current row is not checked, and then the hidden column is summed.
Check box full selection function for reference: JS full selection of check button widgets and batch operation
III. Example
1) Data preparation
Create a new workbook and add the built-in dataset Embedded1 as follows:
2) Template design
The template looks like this:
Drag the ordinal and quantity fields into B2 and C2 cells, respectively, and set the left parent of B2 cell to none.
Right-click the A2 cell widget Settings, select the check box widget for the widget type, and set the left parent of the A2 cell to B2.
Write the formula IF(A2 = TRUE, C2, 0) in cell D2 and SUM(D2) in cell C3.
Right-click column D to hide column D.
3) Save and preview
Save the template, select Data Entry Preview to see the above effect.