Hello All,
I have a large spreadsheet which I am working off (20+K rows)
The following is a formula which I wrote, but when I fill down, it takes a long time to process, so just wondering if there is a way to simplify it.
Any help would be greatly appreciated.
I have a large spreadsheet which I am working off (20+K rows)
The following is a formula which I wrote, but when I fill down, it takes a long time to process, so just wondering if there is a way to simplify it.
Any help would be greatly appreciated.
Code:
=IF(A1="","",
IF(COUNTIF(C:C,C1)=1,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=2,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=3,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=4,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=5,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=6,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=7,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=8,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=9,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:I1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=10,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:I1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:J1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=11,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:I1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:J1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:K1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=12,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:I1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:J1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:K1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:L1),$A$1:$G$999999,7,0),"")),
IF(COUNTIF(C:C,C1)=13,CONCATENATE(IFNA(VLOOKUP($C1&COLUMNS($A$1:A1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:B1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:C1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:D1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:E1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:F1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:G1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:H1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:I1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:J1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:K1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:L1),$A$1:$G$999999,7,0),""),"|",IFNA(VLOOKUP($C1&COLUMNS($A$1:M1),$A$1:$G$999999,7,0),"")),
""))))))))))))))
Last edited: