简体   繁体   English

向 Google 表格中的数组公式添加 IF

[英]Add an IF to an arrayformula in Google Sheets

I have a simple one that is driving me nuts.我有一个简单的让我发疯的方法。
I have a long list of NPS scores and I need to create a new column and add the following formula.我有一长串 NPS 分数,我需要创建一个新列并添加以下公式。

=if(A3<=6,"Detractor",if(A3>=9,"Promoter","Neutral"))

It works great if I drag to the bottom but I can't always do that and need to use an arrayformula but I'm pulling out what hair I have left trying to make it work :(如果我拖到底部,它会很好用,但我不能总是这样做,需要使用 arrayformula 但我正在拔出我留下的头发试图让它工作:(

try:尝试:

=ARRAYFORMULA(IF(A3:A<=6, "Detractor", IF(A3:A>=9, "Promoter", "Neutral")))

or advanced:或高级:

=ARRAYFORMULA(IF(A3:A="",, IF(A3:A<=6, "Detractor", IF(A3:A>=9, "Promoter", "Neutral"))))

您应该将单个单元格更改为单元格数组

=ArrayFormula(IF(LEN(A3:A)>0,(IF(A3:A<=6,"Detractor",IF(A3:A>=9,"Promoter","Neutral"))),""))

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM