How do I count nonblank cells that meet criteria in another cell?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add nonblank cells (cells have text) in a column that equal the
criteria of another cell. So I want to add the cells in Column C that have
text but also equal the date in Column A (which is equal to the date in Cell
A1).

I have tried the follwoing:
=SUM(IF(A2:A19=A1,IF(C3:C19="x",1,0)))
=COUNT(IF((A2:A19=A1),C2:C19))
=IF((A2:A19)=A1,COUNTIF(C2:C19,"x"))

Thanks for any help on this matter... I am sure it is an easy fix.
 
The ranges need to be the same size. Try...

=SUM(IF(A2:A19=A1,IF(C2:C19="x",1,0)))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Domenic:

Thanks that worked....what do I need to replace "x" with in the formula if I
want it to find ANY text (non blank cells)?
 
jimswinder said:
Domenic:

Thanks that worked....

You're welcome!
what do I need to replace "x" with in the formula if I
want it to find ANY text (non blank cells)?

Try...

=SUM(IF(A2:A19=A1,IF(C2:C19<>"",1,0)))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Thanks once again....that will do it.

Domenic said:
You're welcome!


Try...

=SUM(IF(A2:A19=A1,IF(C2:C19<>"",1,0)))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Well...it worked in my very simple test spreadsheet...but not my actual one
where I have several different worksheets....one where I am putting the
formula and another where it is looking for/at the data. I don't know how I
could explain or show you what I am actually wanting to do without sending
you the spreadsheet.
 
Is the formula returning an error message? If so, which one? Or are
you getting an incorrect result?
 
an incorrect result...it always comes up as "0"

Domenic said:
Is the formula returning an error message? If so, which one? Or are
you getting an incorrect result?
 
Sorry...I didn't know about the CONTROL+SHIFT+ENTER.

When I do that, it doe now work, but it has put brackets { } around the
whole formula. What does that mean?
 
jimswinder said:
Sorry...I didn't know about the CONTROL+SHIFT+ENTER.

When I do that, it doe now work, but it has put brackets { } around the
whole formula. What does that mean?

It indicates that you've entered the array formula correctly. For
additional information, see the help menu under 'array formula'.
 
Sorry...I didn't know about the CONTROL+SHIFT+ENTER.

When I do that, it doe now work, but it has put brackets { } around the
whole formula. What does that mean?

It means it's an array formula.
 
How come the formula did not work until I did the CONTROL +SHIFT+ENTER??

Because until then you didn't have an array formula.

As stated above:
"For additional information, see the help menu under 'array formula'."
 

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

Back
Top