You want this option?
COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
criteria_range1 (required) - defines the first range to which the first condition (criteria1) shall be applied.
criteria1 (required) - sets the condition in the form of a number, cell reference, text string, expression or another Excel function. The criteria defines which cells shall be counted and can be expressed as 10, "<=32", A6, "sweets".
[criteria_range2, criteria2]… (optional) - these are additional ranges and their associated criteria. You can specify up to 127 range/criteria pairs in your formulas.
or you can use addition of multiple countif function as below:
=COUNTIF(A:A, A2) + COUNTIF(Sheet2!A:A,Sheet1!A2)