0

I need all combination of two columns.

First column:

+----+
|  4 |
|  8 |
+----+

Second column:

+----+
|  5 |
|  6 |
+----+

And the output should look like this:

+-----+-------+
|   4 |     5 |
|   4 |     6 |
|   8 |     5 |
|   8 |     6 |
+-----+-------+

Is it possible?

SOLUTION:

Third column:

=IF(ROW()-ROW($F$1)+1>COUNTA(A:A)*COUNTA(B:B),"",INDEX(A:A,INT((ROW()-ROW($F$1))/COUNTA(B:B)+1)))

Fourth column:

=IF(ROW()-ROW($F$1)+1>COUNTA(A:A)*COUNTA(B:B),"",INDEX(B:B,MOD(ROW()-ROW($F$1),COUNTA(B:B))+1))
kevas
  • 551
  • 2
  • 7
  • 22

1 Answers1

1

Third column:

=INDEX($A:$A,ROUNDUP(ROWS(C$1:C1)/COUNTA($B:$B),0))

Fill down until 0 appears

Fourth Column:

(Not the most elegant formula, but it does the job)

=INDIRECT("B"&IF(ROW()-COUNT(B:B)*ROUNDDOWN(ROW()/COUNTA(B:B),0)<>0,ROW()-COUNT(B:B)*ROUNDDOWN(ROW()/COUNTA(B:B),0),COUNT(B:B)))

Fill down until last row in Column C

This supposes your data is in columns A and B, there is no blank cells between values and your output will be in columns C and D.

FOR CZECH VERSION:

Third column:

=INDEX($A:$A;ROUNDUP(ŘÁDKY(C$1:C1)/POČET2($B:$B);0))

Fill down until 0 appears

Fourth Column:

=NEPŘÍMÝ.ODKAZ("B"&KDYŽ(ŘÁDEK()-POČET(B:B)*ROUNDDOWN(ŘÁDEK()/POČET2(B:B);0)<>0;ŘÁDEK()-POČET(B:B)*ROUNDDOWN(ŘÁDEK()/POČET2(B:B);0);POČET(B:B)))

Fill down until last row in Column C

You should expect all answers in Stackoverflow to be given in English and with non-Europe standards. Translation courtesy of Excel Translator.

I also don't know, if the different arguments are separated by ; in Czech Version as, for example, it's in another countries in Europe. If that doesn't work, just change them with , again.

agustin
  • 1,311
  • 20
  • 42