`IF`语句,有3个可能的答案,每个答案基于3个不同的范围

SQL*_*ged 5 excel if-statement worksheet-function

我有3个数字范围,答案取决于范围.

75-79=0.255

80-84=0.327

85+  =0.559
Run Code Online (Sandbox Code Playgroud)

我试图创建一个计算范围的方程式,但Excel声明我为此函数输入了太多参数.下面是我输入的无效的等式.(X2包含数字)

=IF(X2=75,X2<=79,0.255,IF(X2=80,X2<=84,0.327,IF(X2>=85,0.559,0)))
Run Code Online (Sandbox Code Playgroud)

我也尝试将数字范围输入另一张表格 - Age并收到错误#Value!.

=IF(X2=Age!A1:A5,0.257,IF(X2=Age!A6:A10,0.327,IF(X2=Age!A11:A33,0.559,0)))
Run Code Online (Sandbox Code Playgroud)

Vee*_*Arr 11

=IF(X2>=85,0.559,IF(X2>=80,0.327,IF(X2>=75,0.255,-1)))
Run Code Online (Sandbox Code Playgroud)

说明:

=IF(X2>=85,                  'If the value is in the highest bracket
      0.559,                 'Use the appropriate number
      IF(X2>=80,             'Otherwise, if the number is in the next highest bracket
           0.327,            'Use the appropriate number
           IF(X2>=75,        'Otherwise, if the number is in the next highest bracket
              0.255,         'Use the appropriate number
              -1             'Otherwise, we're not in any of the ranges (Error)
             )
        )
   )
Run Code Online (Sandbox Code Playgroud)