-
Solved: Formula for count if between two dates
All
can anyone help with the following,
I have a row containing peoples age (e.g. 60), i need to add one to the total in my cell if the age is between 55 and 65, can anyone help with this please, i ve tried countif but i think that can only have one criteria?
thanks
gibbo
-
Try this:
=SUMPRODUCT(--(A1:A5>=55),--(A1:A5<=65))
This will count exactly 55 and 65 as well. If you just want inbetween those:
=SUMPRODUCT(--(A1:A5>55),--(A1:A5<65))
Change the A1:A5 to your range. Just note that you cannot use the whole column (i.e. A:A).
-
=COUNTIF(1:1,">=55")-COUNTIF(1:1,">65")
-
Thanks both but neither work for me, I have just realised i should have added something
I am using a formula to work out the age from a date
=IF(D5<>"",DATEDIF(D5,NOW(),"y"),"")
This is the cell I am trying to get the data from, will the fact I have a formula in there make a difference?
thanks
Gibbo
-
gibbo
I don't see why the value being the result of a formula would cause a problem.
Can you attach a sample workbook?
-
Sorry, my mistake, now i ve revisited this it works great
thanks again
Gibbo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules