Cell that shows "sum" of filled cells?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

Is there a function in Excel that will take cell fills and tally up the
count of each one to get a total of cell fills?

i.e., if we have a time sheet sort of spreadsheet, every time we put in "7.5
hours", or whatever, in a cell, tied in to a date, that a cell at the bottom
of the page that says "# of days worked" will calculate the total # of days
worked based on how many cells in the month were filled?

If so, what would this be called, pls? I could find code for doing this
type of thing if I could figure out what this type of thing was called.

Thanks much. :eek:D
 
S

StargateFanFromWork

StargateFanFromWork said:
Sure did. I ended up using COUNTA and it worked like a charm. Thanks.
:eek:D

Actually, I went back to look at COUNTIF because with COUNTA, I'd have to
leave a cell blank if I didn't want it to be counted rather than putting a
hyphen in, or even "0". Either of these would be better than leaving
pertinent cells blank yet either of these would be counted in the total
something I didn't realize would happen though I should have, looking at
this in hindsight.

COUNTIF sounds like it would do the job but I ran into an error with my
formula so know I'm doing something wrong.

=COUNTIF(B3:H3,B6:H6,B9:H9,B12:H12,B15:H15,B18:H18,">0")

I guessed and used the ">0" but I could be wrong. Also, after typing this
all in myself and after getting the error, I used the help method for
putting in the formula and the formula was identical to the one I initially
put in. Both methods returned the same error code.

Where am I going wrong above, pls? Thanks! :eek:D
 
R

Rowan Drummond

Countif only takes two arguments so you could do it like this:
=COUNTIF(B3:H3,">0")+COUNTIF(B6:H6,">0")+COUNTIF(B9:H9,">0")+COUNTIF(B12:H12,">0")+COUNTIF(B15:H15,">0")*COUNTIF(B18:H18,">0")

Hope this helps
Rowan
 
S

StargateFanFromWork

Rowan Drummond said:
Countif only takes two arguments so you could do it like this:
=COUNTIF(B3:H3,">0")+COUNTIF(B6:H6,">0")+COUNTIF(B9:H9,">0")+COUNTIF(B12:H12
,">0")+COUNTIF(B15:H15,">0")*COUNTIF(B18:H18,">0")

Hope this helps

Sure did. That did the trick and it's much better than COUNTA as now I can
put either a 0 or a - and those cells don't get counted yet there is still
that needed reference.

Thanks! :eek:D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top