Last active
May 5, 2021 08:48
-
-
Save Max-Makhrov/ce3b06e2bcb1ed2d3a8be4fd1b4c48d0 to your computer and use it in GitHub Desktop.
Formulas for Cartessian cross-join in Google Sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=ArrayFormula( | |
VLOOKUP( | |
CEILING(ROW(OFFSET(INDIRECT("A1"),,,COUNTA(A2:A)*COUNTA(B2:B)))/COUNTA(B2:B)) , | |
{ROW(A2:A)-row(A1),A2:A} , 2, ) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=ArrayFormula( | |
VLOOKUP( | |
MOD(ROW(OFFSET(INDIRECT("A1"),,,COUNTA(A2:A)*COUNTA(B2:B)))-1,COUNTA(B2:B))+1 , | |
{ROW(B2:B)-ROW(B1) , B2:B} , 2 ,) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment