Count Qty of Cells with a value in

Steve Swift

Board Regular
Joined
Jan 18, 2004
Messages
187
Hi all,

I'm sure this should be easy but I can't figure out how and I hope someone can help me out.

I have Column C that contains names of sales staff and column H that contains the relevant commision for that member of staff. So for example

C1 = Amanda H1 = 10.00
C2 = Carol H2 = 11.00
C3 = Amanda H3 = 12.00
C4 = Amanda H4 = 0.00

So I already calculate the commission amount with a SUMIF (C:C,E32,H:H) where E32 is the ref cell for the name Amanda.

What I need to show as well is the number of cells that contain a value greater than 0 against Amanda name. In my example above I would be expecting the result

Amanda = 2
Carol = 1



Thanks in advance.

Steve
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

Thanks for that it works perfect over just those cells but is there any way I can make it look up the whole column C:C & H:H which seems the best option as it varies daily as more items are added. Currently for example I have 24 rows in the sheet at the moment so this works

=SUMPRODUCT(--(C1:C24="Amanda"),--(H1:H24>0))

but this doesn't

=SUMPRODUCT(--(C:C="Amanda"),--(H:H>0))

Thanks again

Steve
 
Upvote 0
You cannot use entire column references like C:C in this formula.

You could however:

C1:C65535
 
Upvote 0
Try

=SUMPRODUCT(--(C1:C65536="Amanda"),--(H1:H65536>0))

65536 is the maximum number of rows per worksheet
 
Upvote 0
sbeatton said:
Try

=SUMPRODUCT(--(C1:C65536="Amanda"),--(H1:H65536>0))

65536 is the maximum number of rows per worksheet

Unfortunately, in some verions that formula automaticly changes into =SUMPRODUCT(--(C:C="Amanda"),--(H:H>0)) and thus error out.

Thus my suggestion above.
 
Upvote 0
Thanks very much,

Had to use the 65535 as did experience the problem with 65536


It works:)

Best Regards

Steve
 
Upvote 0

Forum statistics

Threads
1,214,541
Messages
6,120,110
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top