Wednesday, November 30, 2011

yogi_LookUp The Value Of An Entity From A Given Table Of Data

Yogi Anand, D.Eng, P.E.                                         Google Spreadsheet                  
user superfast502 said:
Write a conditional if statement where a value can fall within 6 different ranges?
If I have a range of six values (a1,a2,a3,a4,a5,a6), and the distance between say a1 and a2 is 'range1', a2 and a3 is 'range2', and a3 to a4 is 'range3', etc. The final number (a8) how do I write a function that would tell me which range the final number fell into?
For example:
a1 = 118
a2 = 123
a3 = 129
a4 = 132
a5 = 135
a6 = 140
a7 = 146
Between 118 and 123 is range1
Between 123 and 129 is range2
Between 129 and 132 is range3
Between 132 and 135 is range4
Between 135 and 140 is range5
and finally between 140 and 146 is range6.
I have a final value, say 124. How do I get the spreadsheet to display "range2"
or, if the final value is say 133 the spreadsheet would display "range4"
Sure appreciate any help I can get.
Thank you.


following is solution to the problem: