Yes, you can use the Subtotal function with an If criteria to sum only the values in column B where column C is equal to Y. Here's how:
- Click on cell B8 where you want to display the subtotal.
- Type the following formula:
Code:
=SUBTOTAL(9,IF(C2:C6="Y",B2:B6))
- Press Ctrl+Shift+Enter to enter the formula as an array formula. This will ensure that the formula calculates correctly.
- The subtotal will now be displayed in cell B8, and it will only include the values in column B where column C is equal to Y.
Note: The IF function checks each cell in column C to see if it contains the value "Y". If it does, the corresponding value in column B is included in the subtotal. If it doesn't, the value is excluded from the subtotal. The SUBTOTAL function then calculates the sum of the included values.