View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default formula for range values question

So, presumably you have a "Variable Type" column and an "Outcome"
column - assume these are A and B with the values starting in row 2.
Assume the table above - Variable, Min, Max - is in the same sheet
occupying X1 to Z6 including headings. Try this formula:

=IF(OR(A25,A2<0),"Invalid
variable",IF(B2<VLOOKUP(A2,$X$2:$Z$6,2,0),VLOOKUP( A2,$X$2:$Z$6,2,0),IF(B2VLOOKUP(A2,$X$2:$Z$6,3,0), VLOOKUP(A2,$X$2:$Z$6,3,0),B2)))

Copy down as necessary.

Hope this helps.

Pete