Forum Discussion
How to Count of invoice numbers in a column
The array of dates and invoice numbers has 11 rows. If you select the MATCH or the ROW part of the formula and press F9 the results are shown in the formula bar. You can see them in the pictures in the attached file. The "then" part of the IF formula compares these results. You can return to the formula with ctrl+Z.
This is my way of understanding your approach. Range references always were meaningless to me so refactoring was a key element of my understanding a formula. I never could tell whether the result was more intelligible or whether it was simply that the refactoring process provided insight.
= LET(
recordNum, SEQUENCE(ROWS(sourceData)),
selectedDate?, sourceDate=@date,
selectedInvoice, IF(selectedDate?,invoice),
firstMatch, MATCH(selectedInvoice, selectedInvoice,),
SUM(N(IF(selectedDate?, firstMatch=recordNum))))It wouldn't have been quite like this a year or two ago, but LET and LAMBDA are now so deeply engrained in my thought process, I almost forget how things used to be.