I am looking for a flexible custom function to be able to cross-join (cartesian product) 2 columns of varying lengths in Google Sheets.
My research so far has led me to ask because:
- using a combination of existing formulas in Sheets either produces some weird artifacts (counting blank cells as values to cross-join) or has limits to how many results it can produce.
- The JavaScript solutions online pertain to specific examples and have not worked for my case yet (I have very limited knowledge of JavaScript).
To further describe my request:
- It must be able to cross-join 2 columns of ANY length (if one column is longer than the other, I don't want it to utilize blank cells from the shorter one).
- I would love it to be flexible in that I can place it anywhere and use any combination of columns
Edit 1:
Sorry for any missing information, it's my first time posting here
So I'm not sure how many formulas I have tried but it's been over 20, I'm not sure how productive it would be to post those in here because I'm looking for JavaScript at this point.
Here's an example of some data sets and results I would like to get from this one script:
I've seen many scripts be dependent on the header name and stuff and I would like that not to be the case.