View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default Variable Or Command

Hi,

I not exactly clear if your are just trying to return TRUE if anyone is true
or you want to sum all the elements that would return TRUE. Lets suppose the
latter

=SUM(IF(INDIRECT("K2:K"&L2)<=30,INDIRECT("K2:K"&L2 ),0))

This is array entered (Shift+Ctrl+Enter) and it sums all the item in the
range K2:Kx which are <=30.

If this helps, please click the Yes button.


--
Thanks,
Shane Devenshire


"str83dgeboi" wrote:

I am trying to figure this out... I want to do something like

=OR(K2:K(L2) <=30) where L2 is a variable number, so it would end up being

L2 = 4 (but it is the sum of several numbers used else where)
=OR(K2:K4 <=30)
and this way it checks if
K2 <= 30
K3 <= 30
K4 <= 30

And will return True if one of these is true...

I tried =OR(INDIRECT("K"&2&":K"&$L2) <=30)
Which only checks the first one and not the others

Any ideas?