ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   count values in a range of cells depending on value in adjacent ce (https://www.excelbanter.com/excel-worksheet-functions/210653-count-values-range-cells-depending-value-adjacent-ce.html)

birdgirl31

count values in a range of cells depending on value in adjacent ce
 
I have a spreadsheet with names in column A and names are often repeated
within this column. Columns B - E have values. I want to count the valuies in
each column only if the name in the row is ""Bob"?

I also sometimes want to count the values in each column if the name is
"Bob" or "Dave"?


T. Valko

count values in a range of cells depending on value in adjacent ce
 
Columns B - E have values.

values = numbers?

Try these:

=SUMPRODUCT((A1:A10="Bob")*(ISNUMBER(B1:E10)))

=SUMPRODUCT(((A1:A10="Bob")+(A1:A10="Dave"))*(ISNU MBER(B1:E10)))

Better to use cells to hold the criteria:

G1 = Bob
H1 = Dave

=SUMPRODUCT((A1:A10=G1)*(ISNUMBER(B1:E10)))

=SUMPRODUCT(((A1:A10=G1)+(A1:A10=H1))*(ISNUMBER(B1 :E10)))


--
Biff
Microsoft Excel MVP


"birdgirl31" wrote in message
...
I have a spreadsheet with names in column A and names are often repeated
within this column. Columns B - E have values. I want to count the valuies
in
each column only if the name in the row is ""Bob"?

I also sometimes want to count the values in each column if the name is
"Bob" or "Dave"?





All times are GMT +1. The time now is 04:14 AM.

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