When using Excel logic functions such as COUNTIF and SUMIF which involve ranges being evaluated based on criteria, you cannot select the criteria from the range of data you are evaluating. This is a very common error.

Required knowledge:

1. String criteria

the data file and follow along:

The example below is an extract of some data where the COUNTIF function is used to analyse the number of respondents living in each area. You can add the criteria value to the function literally: =COUNTIF($B2:$B13, "Crags"), but then you have to edit every row’s calculation manually after you copy it down to the remaining rows.

Incorrectly selecting criteria in an Excel function.Correctly selecting criteria in an Excel function.

Notice how carefully the cells have been laid out for the calculation of the answers, specifically the labels in the range E15:E20. This allows you to use the labels in your functions & formulae and facilitates the easy and correct copying of your functions & formulae (using the Auto Fill series function). The labels and headings also make it really easy for someone to understand the data you are presenting.

2. Cell reference criteria

Rather than type the criteria in as a string, we will use a cell reference as the criteria. This allows us to use the following formula in cell F15:

=COUNTIF($B2:$B13, E15)

By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from stylus

Subscribe now to keep reading and get access to the full archive.

Continue reading