'Excel formula to be conditional on sequence of 'guesses'

enter image description here

The columns of interest are bonus? and points_earned. For each day, players submit a number of guesses, and I'm trying to write a formula for the bonus? column such that if a player has 3 or fewer guesses on 2 consecutive days, then the bonus column returns Yes.

In the picture, I've provided an example. For John Doe, on 1/28/22, bonus? is "No" because it is the first day and the streak below 3 guesses is 1. But on 1/29/22, that streak is now 2, and bonus? is now "Yes". On 1/30/22, John Doe records a score <= 3 but bonus? returns "No" because I want the streak to restart after a Yes has been recorded on the previous day.

Similarly for Jane Doe, on 1/28/22 and 1/29/22, both are "No" because the streak was 1 on 1/28/22 but a guess of 4 was recorded on 1/29/22. On 1/30/22 and 1/31/22 however, we have a streak of 2 and bonus? returns "Yes".

Also, the points_earned column is going to map the 'guesses' to the score, which will be equal to points_earned. If a player received a bonus, then 2 extra points will be added to points_earned.

How can I write a robust formula for the bonus column?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source