Forum Discussion
PeterBartholomew1
Nov 12, 2022Silver Contributor
FIFA World Cup 2022. A demonstration of Lambda functions.
2022 FIFA World Cup Qatar Free Predictor Template For Excel (spreadsheet1.com) Again, this year I worked with Petros to produce an update for the 2022 FIFA World Cup. The striking thing was that so...
Patrick2788
Nov 15, 2022Silver Contributor
After reviewing your solution extensively I've come to a few conclusions.
1. the BYROW portion of AnalyseĪ» seems inevitable given the arrangement of the data and the approach to cleaning up the original matrix with ToArray. I played with using multiple arrays with MAP to get comparable results, but stopped myself because while it may be possible to achieve the results in 'fewer' steps, the solution would be a lot messier and difficult to read.
2. the inability of COUNTIF/SUMIF (and others) to handle dynamic arrays really stands out. Your solution to separate the goals from the teams and compare the two matrices with BYROW and the help of SumĪ» is as clean as any approach I can think of here.
3. I did consider the old blunt instrument approach to the range using a series of SUMIFS and COUNTIFS but ultimately, I'd need to consolidate and stack. A longer, methodical approach is still cleaner and easier for others to understand.
I did play with MUNIT a bit and see where I could use it in the Word Search Lambda to support diagonal words. The only thing holding me back there is the fact that diagonal "arrays" really aren't a thing in Excel and any solution would be to see if it could be done.
- PeterBartholomew1Nov 15, 2022Silver Contributor
I don't think MUNIT is ever likely to achieve "Most Valuable Function" status!
I suppose one could always define
DiagSplitĪ» = LAMBDA(w, LET( n, LEN(w), k, SEQUENCE(n), letter, MID(w,k,1), diag, MUNIT(n), IF(diag,letter,"") ) ) = DiagSplitĪ»(word)
- Patrick2788Nov 15, 2022Silver ContributorDiagonals may be more trouble than it's worth, now that I look at MUNIT again. It seems I'd probably go the familiar route of text manipulating: joining, splitting, wrapping, etc.