ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Multiple countif lookup (https://www.excelbanter.com/excel-worksheet-functions/141719-multiple-countif-lookup.html)

Bruce Hancock[_2_]

Multiple countif lookup
 
Ok here goes, I have a table that has a salespersons name in column A (rows
2-62) and a profit value in column G (rows 2-62 also). I want to count only
the specific salespersons name and values greater than 0 and return a
percentage figure.
For example salesman A has sold 22 cars (22 seperate entries in column A)
and on 11 of these he has sold accessories (11 0 entries and 11 =0 entries
in column G). I need a formulae that will return 50% (or 0.50) by counting
the number of entries greater than 0 in column G and dividing it by the
number of times salesman A appears in column A.
HELP PLEASE.

Dave Peterson

Multiple countif lookup
 
=SUMPRODUCT(--(A1:A100="bruce"),--(ISNUMBER(G1:G100)),--(G1:G1000))
/COUNTIF(A1:A100,"Bruce")

(all one cell)

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

Bruce Hancock wrote:

Ok here goes, I have a table that has a salespersons name in column A (rows
2-62) and a profit value in column G (rows 2-62 also). I want to count only
the specific salespersons name and values greater than 0 and return a
percentage figure.
For example salesman A has sold 22 cars (22 seperate entries in column A)
and on 11 of these he has sold accessories (11 0 entries and 11 =0 entries
in column G). I need a formulae that will return 50% (or 0.50) by counting
the number of entries greater than 0 in column G and dividing it by the
number of times salesman A appears in column A.
HELP PLEASE.


--

Dave Peterson

Bruce Hancock[_2_]

Multiple countif lookup
 
Superb. Thanks a lot.

"Dave Peterson" wrote:

=SUMPRODUCT(--(A1:A100="bruce"),--(ISNUMBER(G1:G100)),--(G1:G1000))
/COUNTIF(A1:A100,"Bruce")

(all one cell)

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

Bruce Hancock wrote:

Ok here goes, I have a table that has a salespersons name in column A (rows
2-62) and a profit value in column G (rows 2-62 also). I want to count only
the specific salespersons name and values greater than 0 and return a
percentage figure.
For example salesman A has sold 22 cars (22 seperate entries in column A)
and on 11 of these he has sold accessories (11 0 entries and 11 =0 entries
in column G). I need a formulae that will return 50% (or 0.50) by counting
the number of entries greater than 0 in column G and dividing it by the
number of times salesman A appears in column A.
HELP PLEASE.


--

Dave Peterson



All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com