# countif or sumif formula tricky one

Hi Experts excel 2007

I am trying to count the number of results between set dates..I have the following table.

col A.         Col B. Case 1.       Col C Result
1.                             6.                  Sum of values falling into 1-3 cat based on colA
2.                             5
3.                             8
4.                             1.                  Sum of val <4 based on col A
5.                             2
6.                             9
7.                            10
###### Who is Participating?

Commented:
ok here it is you should use SUMIFS

for >=1 and <=3 this is the formula
=SUMIFS(B2:B8,A2:A8,">=1",A2:A8,"<=3")

for<4 this is the formula
=SUMIFS(B2:B8,A2:A8,"<4")

and you can see it in the attached file.
gowflow
SUMIFS.xlsx
0

Commented:
a bit not clear
counting results between set dates but see no dates here.
then
Sum of values falling into 1-3 cat based on colA
of what of Col B ?

Sum of val <4 based on col A
also not clear

then
Col A is figures 1,2,3,4 etc.... ? or  ? what is the point for ?

can you post a sample workbook ?
gowflow
0

Author Commented:
Hi gowflow

question1. Sum of values falling into 1-3 cat based on colAof what of Col B ?
I am using col a as a ref table.

Also the count would be 3 records. ..
0

Commented:
Hi,

pls try

``````=SUMIF(A1:A7,"<=3",B1:B7)
``````
and
``````=COUNTIF(A1:A7,"<=3")
``````
Regards
Sumif3.xlsx
0

Author Commented:
Gowflow excellent feedback. ..how would I do the count..
0

Commented:
Well read it again and although you said SUM of values for <4 but then you give the result of 3 then it is no more a SUMIFS but a COUNT

so for <4
=COUNTIFS(A1:A7,"<=3")

You can use them without the S at the end as well but I prefer these as they open the door for multiple criteria if and when needed.
gowflow
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.