total amount based on selections of 1-9, 10-19 and 20-30

G

Guest

I am trying to calculate a total based on the number of items a person
purchases that fall within one of these three amounts (1-9,10-19,20-30). Can
anyone help
 
G

Guest

=SUMPRODUCT(--(A1:A100>=1),--(A1:A100<=9),B1:B100)
=SUMPRODUCT(--(A1:A100>=10),--(A1:A100<=19),B1:B100)
=SUMPRODUCT(--(A1:A100>=20),--(A1:A100<=30),B1:B100)
 
J

JE McGimpsey

One way (though your problem statement is rather vague):

=CHOOSE(INT(A1/10)+1,"Total 1", "Total 2", "Total 3", "Total 3")

(the last "Total 3" is necessary since your third range is bigger than
the first two).
 
G

Guest

Using this formula makes it work just the way I want it to. One issue that I
am not sure how to add into the formula is when cell A1 is empty or has a
zero in it, I would like the cell that provides the total not to show
anything or just a zero value. Otherwise the formula is just what I was
looking for. Any solutions?
 
J

JE McGimpsey

One way:

=IF(A1=0,"",CHOOSE(...))

Pete Elbert said:
Using this formula makes it work just the way I want it to. One issue that I
am not sure how to add into the formula is when cell A1 is empty or has a
zero in it, I would like the cell that provides the total not to show
anything or just a zero value. Otherwise the formula is just what I was
looking for. Any solutions?
 

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