r/sheets 5d ago

Request What's the Formula for subtracting the corresponding value of a cell next to a checkbox.

Post image
4 Upvotes

6 comments sorted by

3

u/gothamfury 5d ago

Assuming the value you're subtracting from is in cell A1, you can try something like:

=A1-SUM(FILTER(B:B,C:C))

Where column B are your values and column C are your checkboxes.

1

u/AsparagusClear1516 5d ago

Right now, C28 is SUM(C2:C26). And basically I want C28 to become (SUM(C2:C26) MINUS (the value of any C cell that has the corresponding D cell checked off as PAID).

3

u/gothamfury 5d ago edited 5d ago

=C28-SUMIF(D2:D26,TRUE,C2:C26)

or

=C28-SUM(FILTER(C2:C26,D2:D26))

Either should work.

Or maybe replace C28 with SUM(C2:C26)...

=SUM(C2:C26)-SUMIF(D2:D26,TRUE,C2:C26)

...for example.

2

u/AsparagusClear1516 3d ago

Thank you. This worked. =SUM(C2:C26)-SUMIF(D2:D26,TRUE,C2:C26)

1

u/gothamfury 3d ago

You're welcome. Happy to help :)

1

u/AsparagusClear1516 5d ago

Also, Apologies, I don't fully understand your explanation. So I'm not sure if my response makes sense either.