I have a Google sheets document arranged like so:
Sheet 1:
A | B | C
tomatoes | 10 | **SUM**
Sheet 2:
A | B | C
2019-01-01T15:00:00 | tomatoes | 2
On Sheet 1, column C, I would like the sum from all rows in sheet 2 where sheet 2 column B matches sheet 1 column A, subtracted from Sheet 1 column B.
Example: Imagine where Sheet 2 had 3 rows the same as shown above, Sheet 1 would then look like:
Sheet 1:
A | B | C
tomatoes | 10 | 4 (10 - 6 = 4)