Finding Current Win/Loss Streak in Google Sheets

Understanding the current winning or losing streak is important when managing sports or gaming data in Google Sheets. In a previous guide, we talked about finding the longest streaks.

In this tutorial, we’ll show you how to easily find and calculate your current winning and losing streaks using Google Sheets. We’ll mainly use the FREQUENCY function, along with other functions, to get the results you need.

The provided formula aims to give you a clear picture of performance trends, helping you make well-informed decisions based on your data.

For practice, we’ll work with data in column A, range A3:A, skipping any empty cells while looking at the current win/loss streak.

Finding current winning or losing streak in Google Sheets

In our example, ‘W’ stands for ‘Win,’ and ‘L’ stands for ‘Loss.’ However, feel free to replace ‘W’ and ‘L’ with different values, like game or player names, to match your specific situation.

How to Find Current Win/Loss Streak in Google Sheets

For the sample data above, you can use the following formula to find the winning or losing streak:

=ArrayFormula(LET(
   winner, TOCOL(A3:A, 1), 
   val, CHOOSEROWS(winner, -1), 
   test, winner=val, 
   data, IF(test, SEQUENCE(ROWS(winner))), 
   classes, IF(test, ,SEQUENCE(ROWS(winner))), 
   current_streak, CHOOSEROWS(FREQUENCY(data, classes), -1), 
   VSTACK(val, current_streak)
))

First, a detailed explanation of this formula will be provided. Following that, you can learn how to modify this formula using the BYCOL lambda to return the current streaks of multiple columns of data.

Formula Explanation

The formula employs the LET function to assign name with the results of value_expression and returns the outcome of the formula_expression, representing the current win/loss streak.

Syntax:

LET(name1, value_expression1, [name2, …], [value_expression2, …], formula_expression)

Note: Assigning names can enhance the formula’s efficiency because the value_expressions are evaluated only once in the LET function.

Below are the names, value expressions, and their roles:

  • TOCOL(A3:A, 1): TOCOL returns the range after removing blank cells. The assigned name is winner.
  • CHOOSEROWS(winner, -1): CHOOSEROWS returns the last value in winner. The assigned name is val.
  • winner=val: Matches val in winner and returns TRUE for matches and FALSE for mismatches. The assigned name is test.
  • IF(test, SEQUENCE(ROWS(winner))): IF logical test to return sequence numbers if the test is TRUE; otherwise, it returns FALSE. The assigned name is data. Please refer to Column B in the image below.
  • IF(test, ,SEQUENCE(ROWS(winner))): Returns blank if test = TRUE, else sequence numbers. The assigned name is classes. Please refer to Column C in the image below.
  • CHOOSEROWS(FREQUENCY(data, classes), -1): The key part that returns the current winning or losing streak. The assigned name is current_streak.
Explanation of the role of the FREQUENCY function in the current winning or losing streak
FREQUENCY(data, classes)

We use the FREQUENCY function in Google Sheets to return the frequency distribution of a one-dimensional array into specified classes. The array here is represented by data, and classes are represented by classes.

The output of FREQUENCY will be a range of size one greater than the number of elements in the classes (Please refer to Column D in the image above).

The final value is the number of elements in data greater than any of the class boundaries. That value will be the current streak value. We have employed CHOOSEROWS to extract the value.

  • VSTACK(val, current_streak): The formula which appends val. It will be ‘W’ if the current streak is a winning streak, else “F.”

Finding Current Win/Loss Streaks Across Multiple Sets of Data

Sometimes, you may have multiple sets of data and want to find the current winning or losing streak for each of them separately.

Of course, you can copy-paste the formula and replace the ranges. However, you can use a single formula to return the current winning/losing streaks for multiple sets of data at once.

For example, if the data is in A3:C and we want the current winning/losing streaks of A3:A, B3:B, and C3:C separately, let’s use the BYCOL lambda for this.

Current streaks in multiple columns

Generic Formula: BYCOL(A3:C, LAMBDA(r, current_streak_formula))

In the current_streak_formula, you need to replace A3:C (winner) with r.

Formula:

=BYCOL(A3:C, LAMBDA(r, 
   ArrayFormula(LET(
      winner, TOCOL(r, 1), 
      val, CHOOSEROWS(winner, -1), 
      test, winner=val, 
      data, IF(test, SEQUENCE(ROWS(winner))), 
      classes, IF(test, ,SEQUENCE(ROWS(winner))), 
      current_streak, CHOOSEROWS(FREQUENCY(data, classes), -1), 
      VSTACK(val, current_streak)
   )))
)

Resources

In conclusion, mastering the art of finding the current win/loss streak in Google Sheets opens up a wealth of analytical possibilities. For further exploration, here are a few more related resources.

  1. Winning/Losing/Tie Streaks in a Filtered Range in Google Sheets
  2. Highlight Data Spikes (Consecutive Increases) in Google Sheets
  3. Highlight N Consecutive Decreases in Numeric Data in Google Sheets
  4. Get the Count of Consecutive Occurrences of Values in Google Sheets
  5. Consecutive Dates to Date Ranges in Google Sheets: The REDUCE Method
  6. Get the Most Frequent Keywords from Titles in Google Sheets
  7. How to Filter the Top 3 Most Frequent Strings in Google Sheets
Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

2 COMMENTS

  1. Could this be done in a situation where the data the formula needs to pull from is not in a continuous range but alternating cells? For example, M9, O9, Q9, S9… all the way to AU9. The data in these cells would consist of numerical values. The formula should recognize values greater than 1.5 as ‘W’, less than 1.5 as ‘L’, and exactly 1.5 as ‘T’ (Tie). Additionally, not every cell would necessarily contain a value. Lastly, I would like the final result to be displayed as ‘W3’ or ‘L2’, depending on the streak that the player was on. Thanks!

    • Please make the following two changes:

      Replace TOCOL(A3:A, 1) with TOCOL(FILTER(IFS(LT(M9:AU9, 1.5), "L", EQ(M9:AU9, 1.5), "T", GT(M9:AU9, 1.5), "W"), ISODD(COLUMN(M9:AU9)), NOT(M9:AU9="")), 1)
      Replace VSTACK(val, current_streak) with TEXTJOIN("", TRUE, VSTACK(val, current_streak))

      I hope that helps.

      Updated:

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.