【发布时间】:2018-10-22 16:04:03
【问题描述】:
我正在跟踪玩家在游戏中的表现,我想自动生成玩家的当前连胜。此外,我还想跟踪玩家的最高连胜纪录。我试过查看this、this 和that,但我似乎无法调整公式以适应我的情况。
有 8 个可能的值可以输入到单元格中:
- 攻击胜利
- 攻击失败
- 两次进攻都赢了
- 两次攻击均失败
- 赢了,然后输了
- 输了,然后赢了
- 没有参加
- 被踢
我想要计算连胜的公式,使得 Player1 当前的连胜数为 8,Player2 当前的连胜数为 7,Player3 当前的连胜数为 3,依此类推。
p>我可以使用什么公式而不使用 VBA 来生成相应的连胜记录?
其他案例研究
游戏结果示例
Player | War 1 | War 2 | War 3 | War 4 | War 5
----------------------------------------------------------------------------------------------------------
PlayerA | Attack Won | Both Attacks Won | Win, then Lost | Attack Won | Attack Won
PlayerB | Attack Won | Attack Lost | Lost, then Win | Both Attacks Win | Attack Lost
PlayerC | Attack Won | Did not Participate | Did not Participate | Both Attacks Won | Attack Won
PlayerD | Attack Lost | Attack Lost | Did not Participate | Win, then Lost | Did not Participate
期望的连胜数输出
Player | Highest Win Streak | Current Win Streak
--------------------------------------------------
PlayerA | 3 | 2
PlayerB | 3 | 0
PlayerC | 4 | 4
PlayerD | 1 | 0
谢谢!
【问题讨论】:
-
你应该研究 countif() 函数。
-
@SolarMike 我不确定如何使用 countif() 函数进一步向下查看行并在检测到“丢失”时停止
-
这比看起来更复杂。有多少不同的条目算作连胜?攻击赢/两次攻击都赢/赢,然后输了(3 个可能的条目)?如果在获胜之间没有参与,连续性是否会继续? IE。 win 不是 p win 是 1 还是 2?
-
两次进攻都算2胜吗?
标签: vba excel excel-formula formula