我有一个多天的数据集。每天的记录数不一样。我想对每天的余额进行求和,但是我希望在一天中的正记录数大于2中的负记录数时停止求和!
数据集(我刚才要解释的是,列Obs
不在数据集上)是
Day Situation Result Obs
01 POSITIVE +1 will be add
01 POSITIVE +2 will be add
01 POSITIVE +3 Will not be add, because there is already 2 Positive and 0 negative on this day
01 NEGATIVE -4 Will not be add ...
02 NEGATIVE -1 Will be add
02 POSITIVE +2 add
02 POSITIVE +1 add
02 POSITIVE +3 add
02 POSITIVE +5 Will not be add, because there is already 3 Positive and 1 negative on this day
03 POSITIVE +1 add
03 NEGATIVE -1 add
03 NEGATIVE -2 add
03 NEGATIVE -3 add
03 NEGATIVE -4 add
03 POSITIVE 5 add
03 POSITIVE 6 add
03 POSITIVE 7 add
03 POSITIVE 8 add
03 POSITIVE 9 add
03 POSITIVE 10 will not be add, because there is already 6 positive and 4 negative
每天的总和是:
第一天:+ 1 + 2 = +3
第02天:-1 + 2 + 1 + 3 = +5
第三天:1-1-2-3-4+5+6+7+8+9=+26
我如何使用EXCEL公式?