简体   繁体   English

我怎样才能正确使用 if(and()) function 以便我可以将它拖到一列数字旁边? (谷歌表格)

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

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.我使用 Google 表格,一段时间以来我一直试图让这个公式正确,但对于我沿着一列数据向下拖动的每个单元格,它总是给我“未定义”。

If you're curious, this is for stocks' Relative Strength Index (RSI) – buying & selling rates.如果您好奇的话,这是股票的相对强弱指数 (RSI) – 买入和卖出率。

Some number examples (down a column, starting with A1) are as follows:一些数字示例(向下一列,从 A1 开始)如下:

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

How can I readjust this so that the following formula works?我怎样才能重新调整它以便下面的公式起作用? It goes down column B alongside column A (where the data is)!它沿着 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")))))

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

在此处输入图像描述

delete everything in your column and use in row 1:删除列中的所有内容并在第 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))))

在此处输入图像描述

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以使用哪个Google表格功能? - Which google sheets function can I use for this? 如何正确使用.count function? - How can I use .count function correctly? 我可以将 onEdit function 限制为 Google 表格中的复选框单元格吗? - Can I limit an onEdit function to a checkbox cell in Google Sheets? 如何将casperjs脚本的一部分转换为函数,以便可以多次使用 - How can I turn part of my casperjs script into a function so I can use it multiple times 如何设置通过参数传递给 function 的 int 值并将其分配给全局,以便我可以在 function 之外使用? - how to set a int value passed by parameter to a function and assign it to global so I can use outside of the function? 从应用泛型函数(x,y)的两个现有列创建一个新列,以便我可以使用具有不同列的函数 - Create a new column from two existing columns applying a generic function (x,y) so that I can use the function with different columns 我如何将这个 function 分成 2 个,以便它包含一个主要的 function? - How can I split this function into 2, so that it contains a main function? 如何获取函数参数列表(这样我就可以删除一个函数) - How to get function parameter lists (so I can drop a function) 如何导入随机变量,以便可以在函数中使用random.choice - How to import random so I can use random.choice in my function 如何调用我的布尔函数,以便我可以将 if else 用于 C++ 中的 cout - how to call my boolean function so i can use if else for the cout in c++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM