Thread: sumif with or
View Single Post
  #8   Report Post  
C Glenn
 
Posts: n/a
Default

OK, wait a minute. I did say OR originally; so, let me rephrase.
Instead of "The result of the first formula should be 65 less than the
second", how about "wouldn't it be swell if we could implement this with
a logical AND so that the result of the..."



C Glenn wrote:
I can't get this to work. In every case, the first criteria is applied
and the second is ignored.

Put these numbers in D, starting at D5:

45
123
789
4156
123
456
987
321


Now put these in G, starting at G5:

65
32
8546
123
646
564
6
54

If you put the following in G13:
=SUMIF(D5:D12, {"<900","100"},G5:G12)
it will return the same result as
=SUMIF(D5:D12, {"<900"},G5:G12).

The result of the first formula should be 65 less than the second.






Alok wrote:

Glenn,
This does work but you have to enclose them in quotes. {"<100","250"}
Alok

"C Glenn" wrote:


Somewhat like an implicit OR but it's actually an implicity IN! I'm
wondering if there are any other possibilities, i.e.: <250, 125.
This doesn't work with the curlies.

Thanks.

Aladin Akyurek wrote:

=SUM(SUMIF(B5:B12,{"D*","?D*"},D5:D12))

C Glenn wrote:


I'm trying to do this:

=SUMIF(B5:B12,OR("=D*","=?D*"),D5:D12)

It returns zero each time.

(BTW,
=SUMIF(B5:B12,"=D*",D5:D12)
and
=SUMIF(B5:B12,"=?D*",D5:D12)
both work just fine and return non zero sums.)

So my question is,
Where do I put the OR, or is there another way to do this?