Return multiple scenarios

G

Guest

I am trying to write a formula that will look at a cell and return one of
eight possible values depending on the cell value. Specifically, all base
cell values are between 0-360, and I want a formula that will look at the
value and determine if it is equal to 0, greater than 0 but less than 90,
equal to 90, greater than 90 but less than 180, etc., and return a different
response for each of the 8 possibilities. Is this possible?

Thanks,
Casey
 
G

Guest

Create a 2-column table starting in A1. In A1 enter a 0 (zero). If all of
your test numbers are integers then enter a 1 in cell A2, otherwise enter
0.00001. A3 should contain the formula = A1+90. Copy that down to A9, and
you should see 360 displayed in A9. Put the values that correspond to those
entries in cells B1:B9. Then use this formula to test your numbers

=VLOOKUP(C2,$A$1:$B$9,2)
 
G

Guest

Thanks a million, worked like a charm!

Duke Carey said:
Create a 2-column table starting in A1. In A1 enter a 0 (zero). If all of
your test numbers are integers then enter a 1 in cell A2, otherwise enter
0.00001. A3 should contain the formula = A1+90. Copy that down to A9, and
you should see 360 displayed in A9. Put the values that correspond to those
entries in cells B1:B9. Then use this formula to test your numbers

=VLOOKUP(C2,$A$1:$B$9,2)
 
G

Guest

try something like
=LOOKUP(A1,{0,1,90,91,180,181,270,271,360},{1,2,3,4,5,6,7,8})
if the numbers can be decimals change the first arreay to something like
0,.00001,90,90.00001,180,180.00001,270,270.00001,360
or however many decimals you need
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top