Excel formula question

2010-07-17 2:28 am
A B

H-3 0
H-2 5
H-2 2
H-3 1
K-4 4
NW-1 1
KE-1 3
K-3 1
H-2 2
NW-4 6
H-2 8
K-3 2

Now need to count if (Column A) H-2 and (column B) no of count >0

How to set the formula?

回答 (2)

2010-07-17 5:27 am
✔ 最佳答案
Do you mean:
Count if
[ the value of column A equals to "H-2" ] and
[ the value of column B is larger than 0 ]?

Formula:
=COUNTIFS(A:A,"=H-2",B:B,">0")

Explaination:
COUNTIFS counts if several rules given are all true.
odd number parameters are the reference to the area of data with same size
even number parameters are string expression of a condition given to previous parameter.

2010-07-17 12:20:56 補充:
Due to insufficient information from the question, the answer demonstrates the solution available in Excel 2007.
The solution may be slightly / significantly different in other versions.
2010-07-17 3:07 pm
COUNTIFS 只適用於 excel 2007
其他版本可用以下公式

=SUMPRODUCT((A1:A12="H-2")*(B1:B12>0))


收錄日期: 2021-04-24 10:32:13
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20100716000051KK01284

檢視 Wayback Machine 備份