Count apple based on common ID between two tables
问题 I have two Excel tables that look like this: Table 1 A B C ID Stocked Sale 1 shelf sold 5 display sold 9 shelf sold 12 shelf sold 13 shelf Table 2 P Q ID Stocked a2 apple 88 83 1 apple 9 apple I need to count the total number of apples by common ID, given that apples are: stocked on the shelf in Table 1 sold in Table 1 So, the outcome has to be 2 apples. Here is what I have tried thus far: COUNTIFS(B:B, "shelf", C:C, "sold", Q:Q, "apple") I can't figure out how to count by common id... 回答1: