Search code examples
sqlgoogle-apps-scriptgoogle-sheetsarray-formulasgoogle-sheets-formula

Is there a script to bypass 50000 characters for in-cell formula?


I have this (insanely) long formula I need to run in Google Sheets, and I came across the limit error:

There was a problem

Your input contains more than the maximum of 50000 characters in a single cell.

Is there a workaround for this?


my formula is:

=ARRAYFORMULA(SPLIT(QUERY({B!A1:A100; ........ ; CA!DZ1:DZ100}, 
 "select * where Col1 is not null order by Col1 asc", 0), " "))

full formula is: pastebin.com/raw/ZCkZahpw

apologies for Pastebin... I got a few errors here too:

note 1: due to fact that it's a long formula, the output from it should be of size ~100 rows × 3 columns note 2: so far I managed to bypass JOIN/TEXTJOIN for 50000+ characters even 500000 limits for total cells


Solution

  • UPDATE:

    I managed to enter up to 323461 characters as a formula! by using CTRL + H where I replaced simple =SUM(1) formula with my huge formula from this answer: https://webapps.stackexchange.com/a/131019/186471

    ___________________________________________________________

    after some research, it looks like there isn't any workaround to pull this of.

    recommended savings that were suggested ( shortening: A!A:A, dropping: select *, asc, shortening: "where Col1!=''order by Col1") reduced it a bit and rest was split into two formulas in VR {} array solution.