在Google Sheet上,我目前有一个类似于“原始”表格的单元格:
原始:
Week Starting Date Apple type
12/31/2017 1/4/2018 Green
12/31/2017 1/5/2018 Green
1/7/2018 1/8/2018 Bad - Green
1/7/2018 1/8/2018 Bad - Green
1/7/2018 1/8/2018 Yellow
1/7/2018 1/9/2018 Green
1/7/2018 1/9/2018 Red
1/7/2018 1/9/2018 Red
1/7/2018 1/10/2018 Green
1/7/2018 1/10/2018 Yellow
1/7/2018 1/10/2018 Bad - Yellow
1/7/2018 1/12/2018 Yellow
1/14/2018 1/16/2018 Red
1/14/2018 1/16/2018 Yellow
1/21/2018 1/23/2018 Red
1/21/2018 1/23/2018 Bad - Red
1/21/2018 1/23/2018 Yellow
我想写一个公式,它的返回值如下: Summary:
Week Starting Count of all apples Count of only good apples
12/31/17 2 2
1/7/18 10 7
1/14/18 2 2
1/21/18 3 2
我尝试了使用减号、引号等组合的多个countifs,但仍然无法实现。有没有人能给我一些建议?:/
发布于 2018-03-14 07:52:07
这应该能起到作用:
G2:=COUNTIF(A2:A18,F2)
H2:=G2-COUNTIFS($A$2:$A$18,F2,$C$2:$C$18,"*Bad*")
这些公式也适用于Google Sheets
发布于 2018-03-16 23:52:05
对于google-sheets
=QUERY(FILTER({{A:B},{C1;IFERROR(REGEXEXTRACT(C2:C,"Bad"),"Good")}},A:A<>""),"select Col1, Count(Col2) group by Col1 pivot Col3", 1)
这是一个单一的公式解,结果如表所示:
Week Starting Bad Good
12/31/2017 2
1/7/2018 3 7
1/14/2018 2
1/21/2018 1 2
https://stackoverflow.com/questions/49267639
复制相似问题