Create All Possible Combinations From Different Ranges Without Using VBA
Create All Possible Combinations From Different Ranges Without Using VBA
CreateallpossiblecombinationsfromdifferentrangeswithoutusingVBA
Createallpossiblecombinationsfromdifferent
rangeswithoutusingVBA
{ 25Comments }
PostedbyAshishMathuronJuly21,2013inDATACONSOLIDATION
Tagged:MSQUERY,NAMEDRANGES,TABLE
Assumenumbersfrom1to8inrangeB3:B10andnumbersfrom9to16inrangeC3:C10.Theobjectiveistocreateallpossible
combinationsincolumnEfromthesetworangeswithoutusingVBA(macros).Thiscombinedrangeofallpossiblecombinationsis
calledaCartesianproduct.
YoumayrefertothefollowingstepstocreateallpossiblecombinationsincolumnE
1.TypeaheadingincellB2,sayDataSet1.FormatcellB2toBold(Ctrl+B).
2.TypeaheadingincellC2,sayDataSet2.FormatcellC2toBold(Ctrl+B).
3.SelectrangeB2:B10,pressCtrl+F3>Newandinthenamebox,typeData_set1
4.SelectrangeC2:C10,pressCtrl+F3>Newandinthenamebox,typeData_set2
5.SelectrangeB2:B10andpressCtrl+T>OK
6.SelectrangeC2:C10andpressCtrl+T>OK
7.Savethefileatyourdesiredlocation,sayonyourdesktop
8.SelectcellE2andgotoData>FromOtherSources>FromMicrosoftQuery>ExcelFiles>OK
9.IntheSelectWorkbookdialogbox,navigatetothefolderandselectthefilewhichyoujustsavedonthedesktop(instep7above)
andclickonOK
10.WithData_set1selected,clickonthe>symbol
11.SelectData_set2andclickonthe>symbol
12.ClickonNext>OK
13.GotoFile>ReturnDatatoMicrosoftExcel
14.IntheImportDatabox,selectcellE2intheExistingWorksheetboxandclickonOK.Justincase,youdonotseetheImportData
box,afterstep12,pressAlt+Tab.
15.YoushouldnowseeyourdesiredresultinrangeE2:F66.
Furthermore,sinceyouhadconvertedtherangesincolumnBandcolumnCtoTablesindividually,ifyouaddadditionalrowsofdatato
columnBand/orcolumnC,justrefreshwhileyouareclickedonanycelloftheresultrange.Thiswillupdatethetableintheresult
area.
40
15
Like
http://www.ashishmathur.com/createallpossiblecombinationsfromdifferentrangeswithoutusingvba/
1/1