Forum Discussion

  • mtarler's avatar
    mtarler
    Silver Contributor

    JOGINDER SINGH It isn't "pretty" but I believe this does what you need:

    =LET(Data,A6:B12, mains, J6:L6, Flavours, I7:I14,
    _m, TAKE(Data,,1), _s, TAKE(Data,,2),
    MAKEARRAY(ROWS(Flavours),COLUMNS(mains),LAMBDA(r,c,SUM(IFERROR(--(TEXTBEFORE(TEXTSPLIT(","&TEXTJOIN(",",1,FILTER(_s,_m=INDEX(mains,c),"")),INDEX(Flavours,r)&"/",,1,1,""),",",,1,1,"")),0)))))
    • JOGINDER SINGH's avatar
      JOGINDER SINGH
      Copper Contributor
      Thanks for giving your valuable time, But can you tell me that in which cell address this function to be apply?
      • mtarler's avatar
        mtarler
        Silver Contributor
        did you open the attachment? I re-created the headers (left and top) and then that formula is in the upper left corner of the grid. The "Data" variable is set to A6:B12 where the original data set is and then the "mains" variable points to J6:L6 where I copied the header row and "Falvours" points to I7:I14 where I copied the left column. "point" those 3 variable to the correct corresponding parts and the formula will do the rest.
        You could also use UNIQUE and such to create the header and left column dynamically but was sure you needed/wanted that part.

Resources