# Excel help, adding up how many cells contain a value

**URL:** <https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625>\
**Category:** Factual Questions\
**Created:** [October 13, 2009, 4:43am UTC](https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625 "2009-10-13T04:43:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yumblie](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@Yumblie](https://boards.straightdope.com/u/Yumblie)\
**Post date:** [October 13, 2009, 4:43am UTC](https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625/1 "2009-10-13T04:43:22Z")

</div>

Okay, hopefully I can make clear what I’m trying to do. I have a row of values, and in each cell there could be a number, or it could be empty. What I want to do is at the end, add up how many of the cells in this row are occupied. Or, if there’s a function that returns a 1 if there’s something there, or a 0 otherwise, that would be great. Is there a way to do this in excel?

---

<div class="post-metadata">

**Author:** ![GIGObuster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/gigobuster/32/421_2.png) [@GIGObuster](https://boards.straightdope.com/u/GIGObuster)\
**Post date:** [October 13, 2009, 4:59am UTC](https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625/2 "2009-10-13T04:59:43Z")

</div>

=COUNT(value1)

If you need to find if cell A1 has a number, enter =count(A1) in the cell next to it to return a 1 if there is a number and 0 if there is no number.

You can also use the count function to count all the numbers in a column:

=COUNT(A1:A10)

The cells that have no numbers will be ignored.

---

<div class="post-metadata">

**Author:** ![Boyo\_Jim](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@Boyo\_Jim](https://boards.straightdope.com/u/Boyo_Jim)\
**Post date:** [October 13, 2009, 5:00am UTC](https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625/3 "2009-10-13T05:00:00Z")

</div>

=count(a1:a10) will tell you how many cells in that range have values.

---

<div class="post-metadata">

**Author:** ![Yumblie](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@Yumblie](https://boards.straightdope.com/u/Yumblie)\
**Post date:** [October 13, 2009, 4:51pm UTC](https://boards.straightdope.com/t/excel-help-adding-up-how-many-cells-contain-a-value/513625/4 "2009-10-13T16:51:29Z")

</div>

That works, thanks!
