Excel help, adding up how many cells contain a value

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?

=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.

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

That works, thanks!