Transpose data and delete repeted rows Google Sheets

78 Views Asked by At

I have a table in google sheets with +10000 rows.

The sample data of the tables is:

Patient.Data.ID Exam.Data.Date Report.Textblock.Text
146689 9/1/2023 Derecho
146689 9/1/2023 Izquierdo
146689 9/1/2023 Transverso
112792 19/1/2023 Derecho
112792 19/1/2023 Izquierdo
112792 19/1/2023 Transverso

And I want to transpose the last column and delete the repeated ID rows.

Like this:

Patient.Data.ID Exam.Data.Date Derecho Izquierdo Transverso
146689 9/1/2023 1 1 1
112792 19/1/2023 1 1 1

Is there a way to do it without coding? If not, could you help me with the code?

1

There are 1 best solutions below

0
z.. On

Here's a possible solution:

=ARRAYFORMULA(
   LET(a,A2:A,b,B2:B,c,C2:C,
       c_,TOROW(UNIQUE(c),1),
       {A1:B1,c_;
        MAP(UNIQUE(FILTER(a&"|"&b,""<>a)),
          LAMBDA(x,{SPLIT(x,"|"),TOROW(COUNTIF(FILTER(c,x=a&"|"&b),c_))}))}))

enter image description here