Forum Discussion
ShamsM
Oct 16, 2025Copper Contributor
How to retrieve the latest unit cost
Hello, I am sharing a condensed version of a pricing file that lists from Cols A to C Item Codes and pricing by date. The goal is to retrieve the latest unit cost for a particular Item Code. Here is...
SergeiBaklan
Oct 18, 2025Diamond Contributor
Slightly modified m_tarler​ formula to return everything in one run
=LET(
headers, {"Unique Item Code","Latest Unit Cost"},
data, DROP($A:.$C, 1),
sorted, SORT(data,,-1),
codesRaw, CHOOSECOLS(sorted,2),
codes, SORT(UNIQUE( codesRaw )),
VSTACK( headers,
HSTACK( codes,
XLOOKUP(codes,CHOOSECOLS(sorted,2),CHOOSECOLS(sorted,3),,,1)
)
)
)