我怎样才能正确使用 if(and()) 函数,以便我可以将它拖到一列数字旁边? (Google 张)

How can I correctly use the if(and()) function so that I can then drag it down alongside a column of numbers? (Google Sheets)

我使用 Google 工作表,我已经尝试了一段时间正确使用这个公式,但对于我沿着一列数据向下拖动到的每个单元格,它总是给我“未定义”。

如果您好奇的话,这是股票的相对强弱指数 (RSI) – 买入和卖出率。

部分数字示例(向下一列,从A1开始)如下:

我怎样才能重新调整它以使下面的公式起作用?它沿着 B 列与 A 列(数据所在的位置)一起向下移动!

=IF(AND(0<=$A1,$A1<20),"Risky",

IF(AND(20<=$A1,$A1<40),"Oversold",

IF(AND(40<=$A1,$A1<60),"Neutral",

IF(AND(60<=$A1,$A1<80),"Overbought",

IF(AND(80<=$A1,$A1<=100),"Too Risky","Undefined")))))

试试下面的公式-

=IFS(AND(A1>=0,A1<20),"Risky",AND(A1>=20,A1<40),"Oversold",AND(A1>=40,A1<60),"Neutral",AND(A1>=60,A1<80),"Overbought",AND(A1>=80,A1<=100),"Too Risky",A1>100,"Undefined")

删除列中的所有内容并在第 1 行中使用:

=INDEX(IFNA(VLOOKUP(A1:A, 
 {0, "Risky";
  20, "Oversold";
  40, "Neutral";
  60, "Overbought";
  80, "Too Risky";
  101, "Undefined"}, 2, 1)))

更新:

=INDEX(IF(A2:A="",,IFNA(VLOOKUP(B2:B*1, 
 {0, "Risky";
  20, "Oversold";
  40, "Neutral";
  60, "Overbought";
  80, "Too Risky";
  101, "Undefined"}, 2, 1))))

另见:https://webapps.stackexchange.com/q/123729/186471