如何正确使用 if(and()) 函数,以便我可以将其沿着数字列向下拖动? (谷歌表格)

发布于 2025-01-19 06:43:42 字数 520 浏览 3 评论 0原文

我使用Google表格,并且我试图将此公式正确保留一段时间,但它总是为我拖动到一列数据的每个单元格提供了“未定义”。

如果您很好奇,这是针对股票的相对强度指数(RSI) - 购买&销售费率。

某些数字示例(从A1开始)如下:

  • 15
  • 26
  • 44
  • 67
  • 81
  • 60

我如何重新调整此功能以使以下公式有效?它与A列(数据为)列为B列下来!

=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")))))

I use Google Sheets and I have tried to get this formula right for a while now but it always gives me "Undefined" for every cell I drag down to along a column of data.

If you're curious, this is for stocks' Relative Strength Index (RSI) – buying & selling rates.

Some number examples (down a column, starting with A1) are as follows:

  • 15
  • 26
  • 44
  • 67
  • 81
  • 60

How can I readjust this so that the following formula works? It goes down column B alongside column A (where the data is)!

=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")))))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

短暂陪伴 2025-01-26 06:43:42

删除列中的所有内容并在第 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

delete everything in your column and use in row 1:

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

update:

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

enter image description here

also see: https://webapps.stackexchange.com/q/123729/186471

心作怪 2025-01-26 06:43:42

在下面尝试以下配方 -

=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")

“在此处输入图像描述”

Try below formula-

=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")

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文