Công nghệ Dữ liệu Mẹo vặt

Summing a column, filtered based on another column in Google Spreadsheet

Table of Content

Summing a column, filtered based on another column in Google Spreadsheet

Issue

I have the following data in a Google Spreadsheet:

+------+---------+
| Time | Include |
+------+---------+
| 0:30 | No      |
| 1:00 | Yes     |
| 0:30 | Yes     |
| 0:30 | No      |
| 0:30 | Yes     |
+------+---------+

I would like to add up the time where the column to the right is "Yes".

I am using the following to add up all time (3:00):

=SUM(A1:A5)

and I've tried the following to add up the time (2:00) where the adjacent column is Yes, but Google reports "#ERROR!":

=SUM(FILTER(A1:A5;B1:B5="Yes"))

Ans

Just realised FILTER should be comma separated:

=SUM(FILTER(A1:A5,B1:B5="Yes"))

Reference

https://webapps.stackexchange.com/questions/43778/summing-a-column-filtered-based-on-another-column-in-google-spreadsheet

Leave a Reply

Your email address will not be published. Required fields are marked *