# How do I do a count only if there is data

I have an excel spreadsheet with the following columns:

PROGRAMMERS                                       2.00
TECHNICIANS
Billy                    3.50
Jimmy
Bobby                 4.00
INSTALLERS                                              6.00

I want to count how many technicians will be working, but only if they have hours in the second column.  So I would have a cell that would see that Billy and Bobby have hours applied, but Jimmy does not so my cell would say there are 2 technicians.  If I added some hours to Jimmy, then the cell would count 3 technicians.

How do I do this?  Multiple countif criteria?  Sumproduct?

Thanks!
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:

Are the names in the same column as Programmers, Technicians, Installers?

Or in separate columns... if so, then maybe

e.g. =COUNTIFS(B1:B10,"<>",C1:C10,"<>")

counts how many non blanks in B1:B10 match non blanks in C1:C10
0
Commented:
For your exact example, Nothing is going to work at all. Your column A is not filled. Next to the 3 names Billy Jimmy Bob, there is no data to show that they are Technicians. So, fill the Column A according to their Employee Class. Then, use the following formula.

=COUNTIFS(A1:A6,"=Technicians",C1:C6,"<>")

Same thing to the Column B. Only the Technicians section have names. You should fill it so there is no blanks.

So for each line that has hours, there should always be Employee Class, and Employee Name.

NB_VC's formula works only because there are 3 names in Column B. If all sections of employee classes are filled, there would be problem. It will not be only counting Technicians but will count every line that has hours and have a name next to it.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
This is why i mentioned off the bat that I was confused about the setup and asking questions...
0
Author Commented:
I see what you mean.  I put "tech source" as a constant in the first column and the formula worked fine...I know NBVC began the answer on the right path and I wasn't as quick to respond as I should've been...what's the best way to divvy up points?
0
Commented:
Divvy them as you see fit based on the which answer got you closest to the solution and which assisted further.
0
Author Commented:
Thanks for the help!
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.