Google-sheets – way to conditionally delete columns in Google Spreadsheet

google sheets

I have a large spreadsheet with hundreds of columns. About half of the column headings have the word "alone" in them. I need to delete all of the columns that contain "alone" in the header row. Is there a way to accomplish this?

Best Answer

no. however,

you can take it from the other end and create a sheet with a query that will exclude all "alone" columns like:

=ARRAYFORMULA(TRANSPOSE(QUERY(TRANSPOSE(TO_TEXT(A1:D));"select * where Col1 <>'alone' 
                                                                   and Col2 <>'alone' 
                                                                   and Col3 <>'alone'
                                                                   and Col4 <>'alone'")))
etc...