View Single Post
  #21   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_121_] Rick Rothstein \(MVP - VB\)[_121_] is offline
external usenet poster
 
Posts: 1
Default SumProduct but sometimes don't test some criteria

SUMPRODUCT... StoreArray.... Store***Array***....

I missed the array part of StoreArray and its relation to the SUMPRODUCT
function..

I told you I was tired<g

Thanks for pointing that out to me.

Rick


"Ron Coderre" wrote in message
...
Rick

The OR function returns a single value, not an array,
So when any member of StoreArray matches Store, the function returns TRUE
and SUMPRODUCT will include ALL stores.

--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)



"Rick Rothstein (MVP - VB)" wrote in
message ...
If that doesn't work, then I am not understanding something about your
original set up as posted. Unless I am just tired, this

....*OR(StoreArray=Store,Store="All")*......

should produce the same results as this when Store does not equal
"All"...

....*(StoreArray=Store)*......

You said the latter worked when Store is not equal to "All". If Store
does equal "All", then my OR statement will evaluate to TRUE which, when
multiplied by your other terms, is converted to a 1 (which is what your
IF statement proposal suggested you wanted to happen). So, what am I
missing about your setup that my OR statement isn't working for you?

Rick


"Aaron" wrote in message
...
Hi Rick, this ruturns all stores when Store = "All" and when Store =
"Atlanta
Store" (of course I don't want all stores when Store = a specific
store).
I love how simple it is though, any small tweek to get it to work?

"Rick Rothstein (MVP - VB)" wrote:

What about if you use ....*OR(StoreArray=Store,Store="All")*......

Rick

"Aaron" wrote in message
...
On of my criteria is ....*(StoreArray=Store)*......
But somtimes the range Store = "All" which is not a value in
StoreArray.

So I tried .....*(If(store="all",1,StoreArray=Store))*.....

The 1 has the desired effect of skipping this criteria. But my false
statement is not having the desired effect. Any idea how I can do
this?
(I'm
trying not to do a big if statement in the begining with one
sumproduct
scenerio if true and anther if false)