Excel公式查询-函数IF(…)

发布于 2024-10-04 13:45:37 字数 501 浏览 3 评论 0原文

我想在某些单元格的公式中使用 Excel 中的函数 IF() ,如下所示 -

=IF(I2="SELL","(C2-F2)*D2","0")

这意味着我想查看单元格 I2 中是否有文本 - SELL (如果条件为真),那么我希望单元格具有公式为 (C2-F2)*D2,否则如果条件为假,则打印 0。

但问题是,当条件为真时,它不是将文本公式放入,而是将字符串 (C2-F2)*D2 放入它就在那个牢房里。我想要的是,当条件为真时,它应该将 (C2-F2)*D3 解释为该单元格中的公式。我尝试了很多事情,例如 -

=IF(I2="SELL","=((C2-F2)*D2)","0") 

=IF(I2="SELL","=("(C2-F2)*D2)"","0") 

但没有成功。

我怎样才能让它工作?

谢谢你,

-AD

I want to use the function IF() from Excel in a formula for some Cell, as shown below -

=IF(I2="SELL","(C2-F2)*D2","0")

Which means I want to see if Cell I2 has text- SELL in it (IF condition true), then I want the cell to have formula as (C2-F2)*D2, else if condition is false, it prints 0.

But trouble is that when condition is true, instead of putting the formula for the text it is putting the string (C2-F2)*D2 as it is in that Cell. What I want is that when condition is true, it should interpret (C2-F2)*D3 as formula in that cell. I tried many things , like -

=IF(I2="SELL","=((C2-F2)*D2)","0") 

or

=IF(I2="SELL","=("(C2-F2)*D2)"","0") 

but without any success.

How can I get it working?

thank you,

-AD

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

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

发布评论

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

评论(1

薄凉少年不暖心 2024-10-11 13:45:37

推杆

=IF(I2="SELL",(C2-F2)*D2,0) 

正是我一直在寻找的。

谢谢,

-AD

Putting

=IF(I2="SELL",(C2-F2)*D2,0) 

does what i was looking for.

thanks,

-AD

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