Forum Discussion

BDBonnett's avatar
BDBonnett
Copper Contributor
Oct 03, 2025

What is the formula for counting each number from 1to25 that hits from each drawing?

I want to calculate the daily numbers for cash25 lotto. The numbers are drawn on Monday, Tuesday, Thursday, and Friday of each week. Six number from 1 to 25 are drawn each time. I have 157 rows and 7 columns (A-G). The first column is the date and Columns B-G are each number that was drawn. I know I need to do a count in each column of the total times each number is drawn. What is the formula I should enter? Help, please!

 

 

 

2 Replies

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    An option if you want to report all numbers (1..25) drawn or not:

    =LET(
      nums, SEQUENCE( 25 ),
      HSTACK(
        nums,
        BYROW( nums, LAMBDA(rw, COUNTIF( B1:G157, rw ) ) )
      )
    )

     

  • =GROUPBY(TOCOL(B1:G157),TOCOL(B1:G157),LAMBDA(x,COUNT(x)),,0)

    This formula returns the intended result in my Excel online sample sheet.

     

Resources