bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Formulas > Counting Only Money Winners

Counting Only Money Winners

Summary: Do you have a column or row that contains a formula summing a group of other cells? Do you want to count how many of those cells are greater than zero? That’s the problem this user faced, and how to go about it was unclear. This tip presents a couple of formulas you can use to count only those cells desired. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)

Chuck has a worksheet with prize monies to be awarded to the eighty players in his golf league. Each row represents a player, and each column represents the winners of each of the five tournaments held in the season. The sixth column contains a simple formula summing the winnings shown on each row. At the bottom of this sixth column Chuck wants to enter a function that would count the number of players actually receiving monetary awards.

There are several ways you can put together such a formula. You might be tempted to use the COUNTA function, but it won't work. The purpose of COUNTA is to count all the cells that are not empty. This means it will also count cells containing a zero value; they are not empty either.

You could use the SUMPRODUCT function in the following manner:

=SUMPRODUCT((G1:G80>0)*1)

This formula just checks if a cell is greater than zero. If it is, then the True value is multiplied by 1 resulting in a value of 1. If it is False, then the False value multiplied by 1 is 0. The sum of all these values (1 and 0) is then calculated, resulting in a count as desired.

Perhaps the easiest approach, however, is to use the COUNTIF function. This function performs a count only if a particular criteria is met:

=COUNTIF(G1:G80,">0")

In this case, the count only occurs if a cell is greater than zero.

Tip #2421 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003


More Power! Expand your skills and make Excel really sing! It's all possible with macros. The best resource anywhere for macros is ExcelTips: The Macros. Check it out today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home
Vital News Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)