Forum Discussion

Gopal_Gope's avatar
Gopal_Gope
Copper Contributor
May 14, 2024

Need formula for help Excel

Same data in different columns has to be come to one column against the cell

Please find the example in attachment 

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Gopal_Gope 

    I've created a function to accomplish this task:

     

    Organize Lambda
    =LAMBDA(matrix,LET(
        ID, TAKE(matrix, , 1),
        uID, SORT(UNIQUE(ID)),
        TotalA, INDEX(matrix, , 2),
        TotalB, INDEX(matrix, , 3),
        descrip, DROP(matrix, , 3),
        pivot, LAMBDA(acc, v,
            LET(
                record, FILTER(matrix, ID = v),
                a, TAKE(record, 1, 1),
                x, SUM(INDEX(record, , 2)),
                y, SUM(INDEX(record, , 3)),
                details, DROP(TAKE(record, 1), , 3),
                VSTACK(acc, HSTACK(a, x, y, details))
            )
        ),
        DROP(REDUCE("", uID, pivot), 1)
    ))

     

    All you have to do is add the above formula (from line 2 and below) to the name manager as a named item called "Organize".  You can then call the function at the sheet level:

     

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor
    sql:
    select f01,sum(f02),sum(f03),f04,f05 from sheet1 group by f01,f04,f05

Resources