I'm trying to imagine a scenario where that approach would be better than reducing the complexity instead. I'm not saying there isn't one; I'm just noting that hard-coded nested IFs are rarely the best way to approach a problem.
As an example, if your range can be sorted numerically (which your example implies), then you can achieve the same sort of functionality by use of one VLOOKUP() call (in Excel or OpenOffice).
With the 'mode' switch set to 1, or omitted entirely, VLOOKUP will return the exact match if found, or the closest match preceding the target value in an ordered list. So you could define a two-column range with your x/y/z/q values on the left and the corresponding outputs on the right sorted ascending, and reduce the entire thing to one (expandable, if that matters) function call.
(We now return you to your regularly scheduled upgrade notice, already in progress.)
--sofaspud
--"Listening to your kid is the audio equivalent of a Salvador Dali painting, Spud." --OpMegs
As an example, if your range can be sorted numerically (which your example implies), then you can achieve the same sort of functionality by use of one VLOOKUP() call (in Excel or OpenOffice).
With the 'mode' switch set to 1, or omitted entirely, VLOOKUP will return the exact match if found, or the closest match preceding the target value in an ordered list. So you could define a two-column range with your x/y/z/q values on the left and the corresponding outputs on the right sorted ascending, and reduce the entire thing to one (expandable, if that matters) function call.
(We now return you to your regularly scheduled upgrade notice, already in progress.)
--sofaspud
--"Listening to your kid is the audio equivalent of a Salvador Dali painting, Spud." --OpMegs