Creating Comibinaation

patel18nik

New Member
Joined
Nov 23, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to creating possible combination for five columns and I am using below formula which is for 3 columns only, I am trying add 2 more columns but its not letting me or formula is not right?

=IFERROR(INDEX($A$1:$A$3,INT((ROW(1:1)-1)/((COUNTA($B$1:$B$2)*(COUNTA($C$1:$C$3)))))+1)&" "&INDEX($B$1:$B$2,MOD(INT((ROW(1:1)-1)/COUNTA($C$1:$C$3)),COUNTA($B$1:$B$2))+1)&"-"&INDEX($C$1:$C$3,MOD((ROW(1:1)-1),COUNTA($C$1:$C$3))+1),"")

In this formula: A2:A4, B2:B6, C2:C5 are the data ranges that has been used but I wanna use column D and E too.

Thank You,
Nikhil Patel
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Welcome to the Forum!

With Excel 365's dynamic functions, you could do it like this:

ABCDEFGHIJKL
1ABCDE
2A1B1C1D1E1A1B1C1D1E1
3A2B2C2D2E2A1B1C1D1E2
4A3B3C3D3E3A1B1C1D1E3
5C4D4A1B1C1D2E1
6C5A1B1C1D2E2
7A1B1C1D2E3
8A1B1C1D3E1
9ColTotals33543A1B1C1D3E2
10NoRows180601231A1B1C1D3E3
11A1B1C1D4E1
12A1B1C1D4E2
13A1B1C1D4E3
14A1B1C2D1E1
15A1B1C2D1E2
16A1B1C2D1E3
17A1B1C2D2E1
Sheet1
Cell Formulas
RangeFormula
H2:L541H2=INDEX(MyData,MOD(INT(SEQUENCE(PRODUCT(ColTotals),,0)/NoRows),ColTotals)+1,SEQUENCE(,COLUMNS(MyData)))
B9:F9B9=MMULT(SEQUENCE(,ROWS(MyData),,0),--NOT(ISBLANK(MyData)))
B10:F10B10=IF(COLUMN()=MAX(COLUMN(MyData)),1,C10*C9)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
ColTotals=Sheet1!$B$9#H2
MyData=Sheet1!$B$2:$F$6H2, B10:F10, B9
NoRows=Sheet1!$B$10:$F$10H2
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top