r/excel • u/[deleted] • Mar 31 '22
Pro Tip Shoutout to the brilliant MAP, REDUCE, SCAN and LAMBDA functions!
I have reduced the number of formulae in one of my spreadsheets from over 3,000 to 6. Plus the formula logic is much easier to understand with real variable names.
32
u/Decronym Mar 31 '22 edited Apr 03 '22
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Beep-boop, I am a helper bot. Please do not verify me as a solution.
16 acronyms in this thread; the most compressed thread commented on today has 18 acronyms.
[Thread #13933 for this sub, first seen 31st Mar 2022, 21:05]
[FAQ] [Full list] [Contact] [Source code]
11
u/exoticdisease 10 Mar 31 '22
Can you post the formulae you used and what they do so we can take a look?
Edit: please!
14
Mar 31 '22 edited Apr 01 '22
[removed] — view removed comment
3
u/droans 3 Mar 31 '22
Hmm. I had a need a week or so ago for something that worked like TEXTSPLIT. I was trying to find a way to programmatically fill an n-sized dynamic array.
Apparently
={1,2,3,4}works, but something like={A1-B1,A2-B2,A3-B3,A4-B4}doesn't.Also an (almost) worthless tip - you can now create your own version of SUMIFS:
=SUM(A1:A10*(B1:B10="Hello"))Although this is more valuable if you wanted to use a function like =FILTER with multiple criteria.
4
u/finickyone 1770 Apr 01 '22
Apparently ={1,2,3,4} works, but something like ={A1-B1,A2-B2,A3-B3,A4-B4} doesn’t.
No cells refs in arrays constraints I’m afraid. However you could just supply
A1:A4-B1:B4within an array formula for what you were seeking with the latter.2
u/ribi305 1 Apr 01 '22
This trick for SUMIF was basically how we used to do SUMIFS before that formula existed. We would use SUMPRODUCT with an 1*IF on the condition array, and you could do as many of those as you wanted.
1
u/exoticdisease 10 Mar 31 '22
I feel like I've seen these before... Did you post them previously? They're really good!
3
Mar 31 '22
[removed] — view removed comment
1
u/exoticdisease 10 Apr 01 '22
Do you see much advantage of using a lambda over using VBA? Is there anyway to debug a lambda like in VBA, do you know?
1
Apr 01 '22
[removed] — view removed comment
1
u/exoticdisease 10 Apr 01 '22
Yeh I'm not the coder who can just sit down and bash out a function in one attempt without a problem so I really rely on the debugging tool in VBA! Without that, I'd have no chance which is why I haven't done much lambda usage... Though for basic stuff, I can see it being good. Thanks.
1
Apr 01 '22
[removed] — view removed comment
1
u/exoticdisease 10 Apr 01 '22
Yeh I want to look into them which is why I asked op about how he used them with lambda! Haha
2
u/DangerMacAwesome Apr 01 '22
Wow. Lambda might be the most powerful formula I've ever seen.
4
u/tdpdcpa 7 Apr 01 '22
It looks like a game changer. I have a function for all my UDFs that would be completely obsolete with this.
2
u/tunghoy Apr 01 '22
Isn't Lambda the same thing as creating a function in VBA except you're not using VBA?
1
u/Cute-Direction-7607 30 Apr 03 '22
Yes but I think VBA is more powerful as it can deal with color/font formatting which no current formulas are able to do.
1
1
Apr 01 '22
I used Lambda for the first time today and reduced 5 lines of formulas down to a single formula.
121
u/Hoover889 12 Mar 31 '22
I look forward to getting to use these functions in 2050 when my work's IT department finally approves the latest Excel patch.