SUMIF criteria - select a record with >, =, and <

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

Guest

This may be real basic - a basic syntax question.

I have records listed in rows. I have a column listing the age of a person
(column D). I want to select records on the basis of the range a person's age
falls into -- for example, ages 31 to 40. Once selected, I want to sum the
values in another column.

The following command is OK - selecting all those under age 31:
SUMIF(D1:D195,"<31",H1:H195)

I do not think this command is giving me an accurate count - selecting
records between 30 and 40 years of age:
SUMIF(D1:D195,">30*<41",H1:H195)

Am I on the right track?
 
Depending on if you mean < or <=

SUMIF(D1:D195,">30*<41",H1:H195)

SUMPRODUCT((D1:D195>30)*(D1:D195<41)*(H1:H195))

Should work

So I guess you were on the right lines

Regards

Dav
 
try to count
=sumproduct((d1:d21>=31)*(d1:d21<40))
to sum
=sumproduct((d1:d21>=31)*(d1:d21<40),h1:h21)
 

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