Formula to list all possible combinations of 4 rows in excel spreadsheet

scampie

New Member
Joined
Jul 6, 2015
Messages
18
I have a spreadsheet with 4 columns of data. I am trying to work out a formula to work out all possible combinations of the 4 columns. Each column has a different amount of data. It is text data. I had a working formula but Ive somehow broken it :mad: I want the output to contain all 4 of the columns, so don't want the combinations which only include 1,2 or 3 of data sets.

The non working formula I currently have is:

F5
=IF(ROW()-ROW($F$5)+1<=COUNTA($A$5:$A$298)*COUNTA(D$5:D$298)*COUNTA($C$5:$C$298)*COUNTA($D$5:$D$298), INDEX($A$5:$A$298,INT((ROW()-ROW($F$5))/(COUNTA($B$5:$B$298)*COUNTA($C$5:$C$298)*COUNTA($D$5:$D$298))+1)), "")

G5
=IF(ROW()-ROW($F$5)+1<=COUNTA($A$5:$A$298)*COUNTA($B$5:$B$298)*COUNTA($C$5:$C$298)*COUNTA($D$5:$D$298), INDEX($B$5:$B$298,MOD(ROW()-ROW($F$5),COUNTA($B$5:$B$298))+1), "")

H5
=IF(ROW()-ROW($F$5)+1<=COUNTA($A$5:$A$298)*COUNTA($B$5:$B$298)*COUNTA($C$5:$C$298)*COUNTA($D$5:$D$298), INDEX($C$5:$C$298,MOD(ROW()-ROW($F$5),COUNTA($C$5:$C$298))+1), "")

I5
=IF(ROW()-ROW($F$5)+1<=COUNTA($A$5:$A$298)*COUNTA($B$5:$B$298)*COUNTA($C$5:$C$298)*COUNTA($D$5:$D$298), INDEX($D$5:$D$298,MOD(ROW()-ROW($F$5),COUNTA($D$5:$D$298))+1), "")

Help a girl out!

Thanks in advance x
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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