Results 1 to 17 of 17

Lambda MAP combined with HSTACK

Threaded View

Dicken Lambda MAP combined with... 08-08-2024, 09:05 AM
AliGW Re: Lambda MAP combined with... 08-08-2024, 09:24 AM
romperstomper Re: Lambda MAP combined with... 08-08-2024, 10:37 AM
AliGW Re: Lambda MAP combined with... 08-09-2024, 12:32 AM
Fluff13 Re: Lambda MAP combined with... 08-08-2024, 10:04 AM
Dicken Re: Lambda MAP combined with... 08-08-2024, 10:37 AM
Fluff13 Re: Lambda MAP combined with... 08-08-2024, 10:51 AM
romperstomper Re: Lambda MAP combined with... 08-08-2024, 10:56 AM
romperstomper Re: Lambda MAP combined with... 08-09-2024, 03:33 AM
AliGW Re: Lambda MAP combined with... 08-09-2024, 03:47 AM
romperstomper Re: Lambda MAP combined with... 08-09-2024, 03:51 AM
AliGW Re: Lambda MAP combined with... 08-09-2024, 03:54 AM
romperstomper Re: Lambda MAP combined with... 08-09-2024, 04:08 AM
TMS Re: Lambda MAP combined with... 08-09-2024, 04:26 AM
TMS Re: Lambda MAP combined with... 08-09-2024, 04:44 AM
romperstomper Re: Lambda MAP combined with... 08-09-2024, 04:53 AM
TMS Re: Lambda MAP combined with... 08-09-2024, 09:15 AM
  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    771

    Lambda MAP combined with HSTACK

    Hi,

    I have got this working but not sure why initial approach caused an error ;

    sum figures for each year ;

    =LET(yr, UNIQUE(YEAR(D3:D96)),  MAP( yr, LAMBDA(x,SUM( IF(YEAR(D3:D96)= x,F3:F96,0)))))
    but I wanted to stack the result alongside each year Year / value , so I put Hstack in front of the sum;

      =LET(yr, UNIQUE(YEAR(D3:D96)),  MAP( yr, LAMBDA(x,HSTACK(x, SUM( IF(YEAR(D3:D96)= x,F3:F96,0))))))
    this gives a calc error LET(yr, UNIQUE(YEAR(D3:D96)), MAP(yr, LAMBDA(x, x ))) does return the years so I don't see why the problem,

    I have found I can get what I want using ;

                       LET(yr, UNIQUE(YEAR(D3:D96)), HSTACK(yr,  MAP( yr, LAMBDA(x, SUM( IF(YEAR(D3:D96)= x,F3:F96,0)))))) 
    
    or 
    
    =LET(
        yr, UNIQUE(YEAR(D3:D96)), asum,MAP(yr, LAMBDA(x,  SUM(IF(YEAR(D3:D96) = x, F3:F96, 0)))), HSTACK( yr, asum ))

    But if someone can see why the Hstack in front of SUM does not work I would like to know; I have attached workbook all examples;


    Richard
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] CALC Error within LAMBDA
    By Dicken in forum Office 365
    Replies: 2
    Last Post: 07-25-2024, 05:24 AM
  2. [SOLVED] Question about Lambda
    By FT00 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-03-2024, 11:48 AM
  3. Recursive lambda
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-13-2024, 11:51 AM
  4. Need help getting LAMBDA to work
    By Newtonus_Prime in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-21-2023, 09:15 AM
  5. [SOLVED] Incorporate SUM by cell color in a formula with HSTACK, MAP and LAMBDA.
    By lixxy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-21-2023, 06:02 AM
  6. Replies: 14
    Last Post: 09-21-2023, 12:22 AM
  7. [SOLVED] LAMBDA iteration
    By Slabu in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-20-2021, 08:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1