ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Return multiple scenarios (https://www.excelbanter.com/excel-worksheet-functions/75817-return-multiple-scenarios.html)

Casey D

Return multiple scenarios
 
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

Duke Carey

Return multiple scenarios
 
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)


"Casey D" wrote:

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


Casey D

Return multiple scenarios
 
Thanks a million, worked like a charm!

"Duke Carey" wrote:

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)


"Casey D" wrote:

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


bj

Return multiple scenarios
 
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,3 60
or however many decimals you need
"Casey D" wrote:

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



All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com