Options #3 and #4 will work in older versions of Excel.

Starting at zero, SCAN runs through the list of results.

When it encounters a “w”, it adds 1 to a running count.

Using the SCAN function to return all winning streaks

When it encounters any other value, it resets the running count to zero.

SCAN returns the full set of running counts to MAX, which returns the maximum number.

Let’s look at the details.

Using the SCAN function to return all winning streaks

Otherwise, the accumulator is reset to zero.

Notice the count starts over again at zero when there is a loss.

When there are consecutive wins, it increases.

Using the SCAN function to return all winning streaks

In other words, we are marking the end of winning streaks.

Otherwise, the count is reset to zero.

if cell C5 contains “W”, because the header text in cell D4 will cause an error.

Using the SCAN function to return all winning streaks

Do you like tricky formulas?

The key idea is that FREQUENCY gathers numbers into “bins”.

The formula creates a new bin at theendof each winning streak using the row number of the loss.

Using the SCAN function to return all winning streaks

All other bins are created as zero.

The practical effect is a count of consecutive wins in each bin.

The losses become FALSE.

Longest winning streak with helper column

MAX ignores empty cells, the logical values TRUE and FALSE, and text values.

More than one condition can be tested by nesting IF functions.

The IF…

LET Function

The Excel LET function lets you define named variables in a formula.

Excel formula: Calculate win loss tie totals

The output from FILTER is dynamic.

If source data or criteria change, FILTER will return a new set of results.

The number of rows and columns to remove is provided by separaterowsandcolumnsarguments.

Excel formula: Count consecutive monthly orders

Rows and columns can be dropped from the start or end of the given array….

Excel SCAN function

Excel FREQUENCY function

Excel MAX function

Excel IF function

Excel LET function

Excel FILTER function

Excel VSTACK function

Excel DROP function

Using the SCAN function to return all winning streaks