Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Counting Only Money Winners.

Counting Only Money Winners

Written by Allen Wyatt (last updated January 4, 2020)
This tip applies to Excel 97, 2000, 2002, and 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 criterion is met:

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

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

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2421) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Counting Only Money Winners.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Copying a File in VBA

Need to have your macro copy a file from one place to another? It's easy to do using the FileCopy command, described in ...

Discover More

Changing Toolbar Buttons with VBA

Toolbar buttons can have a different appearance depending on their stateâ€"whether they have been clicked or not. This ...

Discover More

Maintaining Word Formatting on Differing Systems

When you open a document on a system other than your own, it is very possible that the document will look different than ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Cell Address of a Maximum Value

Finding the maximum value in a range of cells is easy; finding the address of the cell containing that value is a ...

Discover More

Saving Common Formulas

It is not uncommon to reuse formulas in a variety of workbooks. If you develop some "gotta keep" formulas, here are some ...

Discover More

Determining Business Quarters from Dates

Many businesses organize information according to calendar quarters, especially when it comes to fiscal information. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.