Forum Discussion
Would a FOR.EACH function be useful in Excel 365?
Still working. the present sheet was written as a demonstration of LET relevant to a question on Chandoo. The last entry for each field of a table was returned using XLOOKUP. It is not possible to search multiple rows within a single array formula, so the column is picked up as a relative reference.
Wrapping the formula within FOR.EACH removes the need for relative referencing and returns the results as a dynamic array.
FOREACH replaces relative referencing
Whereas the previous workbooks were created to demonstrate and idea and put it forward for discussion, this time I simply built the formula around an existing solution. The implementation of the macro is still weak but the idea seems to work well.
- Alexbayliss1545Dec 02, 2020Copper Contributor
PeterBartholomew1what are you working on
- PeterBartholomew1Dec 02, 2020Silver Contributor
What I am trying to develop is an approach to building financial or engineering models that is based on the use of dynamic arrays in its entirety. Any input data would be entered into Tables in order to provide structured references that are inherently dynamic. From there, the entire solution should respond to change without any user intervention or any need to create 'oversized' formula ranges.
Other goals are to get rid of the concept direct cell referencing totally (the location on the sheet should be of no more relevance than the position of text on a page, - order matters but not the location). Another advantage is that the concept of relative referencing can also be consigned to the trash can of history; it never was a meaningful concept though it did fit an amateurish way of working that was built on the idea of replicating formulas, rather than recognising arrays and lists as objects.
Whether this is a good place to express the idea that traditional spreadsheet concepts are junk is another matter!
- PeterBartholomew1Dec 05, 2020Silver Contributor
I think these requirements may be met by the new LAMBDA function and recursion.
First though, it needs to make an appearance on my system!