[英]How to use "if statement" in a formula?
Amount数量 | Payment model支付模式 |
---|---|
100 100 | Yearly每年 |
6 6个 | Monthly每月 |
In the 3rd column, I wish to introduce a formula which will automatically read the entry in column "Payment Model".在第 3 栏中,我想介绍一个公式,它会自动读取“支付模式”栏中的条目。 If the entry is, "Yearly" it will just copy the value from column "Amount".如果条目是“每年”,它只会复制“金额”列中的值。 If the entry is, "Monthly" it will multiply the value with 12.如果条目是“每月”,它会将值乘以 12。
Thanks in advance提前致谢
Tried using the "if" statement, its not working.尝试使用“if”语句,它不起作用。 Here is my formula: =IF($B2 == "Yearly",$A2*1,$A2*12)
这是我的公式: =IF($B2 == "Yearly",$A2*1,$A2*12)
Throws me a Formula error everytime.每次都给我一个公式错误。
Excel does not use the double equals. Excel 不使用双等号。
The formula you want, provided by Mayukh Bhattacharya and BigBen :你想要的公式,由Mayukh Bhattacharya和BigBen提供:
=IF($B2="Yearly",$A2*1,$A2*12)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.