I need to sum all of the columns between two given columns in a query.
So, I need to figure out how to create a plus-sign-seperated list of all columns letters, between two given columns letters.
The formula should take two inputs, the starting column (e.g. 'P'), and the ending column (e.g. 'AC'), and output a plus-sign-seperated string of column letters ('P+Q+R+S+T+U+V+W+X+Y+Z+AA+AB+AC')
Input 1: 'P'
Input 2: 'AC'
Expected output: 'P+Q+R+S+T+U+V+W+X+Y+Z+AA+AB+AC'
Example of complete expected query: '=QUERY(data, SELECT "P+Q+R+S+T+U+V+W+X+Y+Z+AA+AB+AC")'
I have tried to tweak a formula I found via a related post without any success.
WIP sheet: https://docs.google.com/spreadsheets/d/1ewNMdx2BXI8pVnZehX4kHrMVAvWNbbjeIW-hrXUIPeA/edit?usp=sharing
Related posts: google sheets, Make letters separated by comma given number of following columns. Not using app script, just formulas please
Any help would be much appreciated!
UPDATE
How to create a plus-sign-seperated list of column letters, between two given column letters?
Formula: =LAMBDA(letters,TEXTJOIN("+",1,FILTER(letters,SEQUENCE(COUNTA(letters))>=MATCH(B3,letters,0),SEQUENCE(COUNTA(letters))<=MATCH(B4,letters,0))))
Note
- In the above mentioned formula, B3 is input1 (i.e. the start column), and B4 is input2 (i.e. the end column).
- The sheet where you place the formula must include the columns you specify in input1 and input2.
Latest demo
https://docs.google.com/spreadsheets/d/1Kl29_0o8mKfeD--vkZHKU3EIf9hl-ts93gX8Ou08EwY/edit?usp=sharing