I want to be able to subtract a value of a total using checkboxes. Let's say I have values in Column A (10,20,56) and A4 is the total, on column B I have checkboxes for each row. Now, when I click on the checkbox next to the value 10, I will like to subtract that value from the total on A4(86), so the result will get 76. Subsequently, if I click on the checkbox next to 20, then the value of the total (A4) will change to 56.
-
Welcome to Web Applications Stack Exchange. Your problem description does not match the screenshot. The answer below follows the description and not the screenshot. Please edit your question and insert a table of sample data. Also consider sharing a publicly editable sample spreadsheet. There is a blank sheet maker that lets you share safely– doubleunaryCommented Feb 19, 2023 at 16:40
Add a comment
|
1 Answer
Use filter()
to get the rows where the checkbox is not ticked, and sum those rows, like this:
=sum(filter(A1:A4, not(B1:B4)))
See filter().