View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default If value between 2 numbers

Actually, my above statement is not entirely true. I like a clean
worksheet and so try to avoid looking at errors returned by formulas.
My first offering accomplishes this if the lookup value is outside the
criteria range[s]. The way I'd use LOOKUP normally would to wrap it in
an IF function so it returns an empty string on error...


=IF(ISERROR(LOOKUP($A1,{1,20,50,75},{"low","med"," high","heavy"})),"",LOOKUP($A1,{1,20,50,75},{"low" ,"med","high","heavy"}))

...and so we lose formula brevity. I this OP's scenario, outside the
range is any value <1. IMO, it's better to *not* have errors propagate
to other cells containing formulas that ref cells with formulas that
return errors!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion