Excel 365 REDUCE and LAMBDA Functions

Thom Hartle – February 19, 2026

This post details using Excel's REDUCE and LAMBDA function to extract particular data from an Excel dashboard tracking many different markets. For example, the image below displays market data for Equities, Energy and Grains.

f1

What might be helpful is a table that lists contracts by the expiration date, such as:

f2

The table displayed above is using the REDUCE and LAMBDA Excel functions to find the expiration date from the Long Description in column "C" and then looking to column "M" and displaying those contracts with a matching expiration date.

The REDUCE Function has a starting point parameter, in this case as this is text, the starting point is blank ("") and the array C2:C32 is declared. Then the LAMBDA function is asking for the text after the first comma, which is the expiration date. Then, the function returns the text before expiration date (the contract description) that matches the dates listed in column M

=REDUCE("",C2:C32,LAMBDA(a,v,IF(TEXTAFTER(v,", ")=M2:M24,a&", "&TEXTBEFORE(v,","),a)))

One issue is the function returns a comma after the description and that can be removed by using the SUBSTITUE function. The first comma is now a blank space.

=SUBSTITUTE(REDUCE("",C2:C32,LAMBDA(a,v,IF(TEXTAFTER(v,", ")=M2:M24,a&", "&TEXTBEFORE(v,","),a))),", ","",1)

The downloadable sample spreadsheet can be modified to use different symbols.

More details regarding the LAMBDA function are from this post: Excel 365 Using the LAMBDA Function.

Requirements: CQG Integrated Client or QTrader, and Excel 365 (locally installed, not in the Cloud) or more recent.

Downloads

Disclaimer

Trading and investment carry a high level of risk, and CQG, Inc. does not make any recommendations for buying or selling any financial instruments. We offer educational information on ways to use our sophisticated CQG trading tools, but it is up to our customers and other readers to make their own trading and investment decisions or to consult with a registered investment advisor. The opinions expressed here are solely those of the author and do not reflect the opinions of CQG, Inc. or its affiliates.