Forum Discussion

shimithnv1987's avatar
shimithnv1987
Copper Contributor
Oct 24, 2023
Solved

excel

agntnlbhAmount
1125220
 125220
    Total40
      
2123212
 125220
    Total32
3124216
    Total16
      
1185280
 125220
    Total100
118102160
 125220
    Total180

return amount while changing column column 1 (agt)

  • Lorenzo's avatar
    Lorenzo
    Oct 28, 2023

    shimithnv1987 

    ...I want to return 40 ,100,189...

    There's no row with Total = 189 in the data you initially exposed so below result is probably not what you expect:

     

    =LET(
      Agnt, SCAN(0,Table[agnt],
        LAMBDA(seed,agnt, IF(ISNUMBER(agnt), agnt, seed))
      ) = I1,
      TRANSPOSE(FILTER(Table[Amount], Agnt * ISNUMBER(XMATCH(Table[h],"total")), ""))
    )

     

10 Replies

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor

     

     

    shimithnv1987 

     

     create temp table aa as 
    select  fillna(f01) grp,* from sheet1;
    //select * from aa;
    select  grp,group_concat(f06,'</td><td>') Totals  from aa where f05 like 'Total' group by grp;
    select  grp,group_concat(f06,'</td><td>') Totals  from aa where f05 like 'Total' and 
    grp=1 group by grp

     

     

    grp Totals

    140100180
    232
    316

    grp Totals

    140100180
  • shimithnv1987's avatar
    shimithnv1987
    Copper Contributor
    What more details ? I want to return 40 ,100,189 corresponding to agmt 1 and 32 corresponding to agmt2 and 16 corresponding to agmt3
    • Lorenzo's avatar
      Lorenzo
      Silver Contributor

      shimithnv1987 

      ...I want to return 40 ,100,189...

      There's no row with Total = 189 in the data you initially exposed so below result is probably not what you expect:

       

      =LET(
        Agnt, SCAN(0,Table[agnt],
          LAMBDA(seed,agnt, IF(ISNUMBER(agnt), agnt, seed))
        ) = I1,
        TRANSPOSE(FILTER(Table[Amount], Agnt * ISNUMBER(XMATCH(Table[h],"total")), ""))
      )

       

      • FRANCOIS_1990's avatar
        FRANCOIS_1990
        Copper Contributor

        Quand je tape la fonction somme, la réponse revient en format date.

Resources