[英]Multiply value by -1 if column x contains a string
Basically what i want to do is to express my excel column sum in -ve if the value in Action is Sell
. 基本上,我想做的就是如果Action的值是
Sell
则在-ve中表达我的excel列总和。 If its Buy
then don't do anything. 如果
Buy
则什么也不做。 Currently, I am doing sum like =B2+C2
but it will always be in +ve no matter if it is representing a purchase or sell order. 当前,我正在执行
=B2+C2
之类的总和,但是无论它代表购买还是出售订单,它总会处于+ ve状态。
Here is some sample data 这是一些示例数据
Notice how Net column shows +ve value even though one value is Sell
and the other one is Buy
. 请注意,即使一个值是
Sell
,另一个值是Buy
Net列也如何显示+ ve值。 I want Sell
to be displayed as +ve value and Sell
to be shown as -ve value. 我希望将
Sell
显示为+ ve值,将Sell
显示为-ve值。
我能够使用=IF(B2="Buy", G2+F2, -1*(G2+F2))
解决我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.