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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Steve Swift

Board Regular
Joined
Jan 18, 2004
Messages
187
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
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
You cannot use entire column references like C:C in this formula.

You could however:

C1:C65535
 

sbeatton

Active Member
Joined
May 19, 2004
Messages
411

ADVERTISEMENT

Try

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

65536 is the maximum number of rows per worksheet
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
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.
 

Steve Swift

Board Regular
Joined
Jan 18, 2004
Messages
187
Thanks very much,

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


It works:)

Best Regards

Steve
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,006
Messages
5,834,835
Members
430,324
Latest member
bosphoruskid

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
Top