如何在Excel中将Countif与两个匹配的标准一起使用?

如何在Excel中将Countif与两个匹配的标准一起使用?,excel,excel-formula,Excel,Excel Formula,当前公式为=COUNTIF(Sheet2!C[-1],Sheet1!RC[-1]) 红苹果的计数应该是“1”。公式是如何修正的,以使列“水果”也匹配的?您可以使用该符号: =COUNTIFS(Sheet2!C[-1],Sheet1!RC[-1],Sheet2!C[-2],Sheet1!RC[-2])也许可以使用COUNTIFS。 Fruit Color Sold Apple Red Yes Shoe Red Yes Fruit Color Count

当前公式为=COUNTIF(Sheet2!C[-1],Sheet1!RC[-1])


红苹果的计数应该是“1”。公式是如何修正的,以使列“水果”也匹配的?

您可以使用该符号:
=COUNTIFS(Sheet2!C[-1],Sheet1!RC[-1],Sheet2!C[-2],Sheet1!RC[-2])

也许可以使用COUNTIFS。
Fruit   Color   Sold
Apple   Red     Yes
Shoe    Red     Yes

Fruit   Color   Count
Apple   Green   0
Apple   Red     2