multiplication of 3 sets

new exceler

New Member
Joined
May 27, 2015
Messages
3
hello every body
i want to calculate all possible results of multiplication of 3 sets: a,b,c with the same members :{1,2,3,4,5,6,7,8,9,10}
in excel ? that is how can i caculate all members of the set m ={a*b*c} in excel?
thanks
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi.

This will produce a list of distinct products beginning in A1:

Code:
Sub Products()

Dim i As Integer, j As Integer, k As Integer

For i = 1 To 10
    For j = 1 To 10
        For k = 1 To 10
            Cells(100 * (i - 1) + 10 * (j - 1) + k, 1).Value = i * j * k
        Next k
    Next j
Next i

Range("A1:A1000").RemoveDuplicates Columns:=1, Header:=xlNo

End Sub

Regards
 
Upvote 0
thank you .it's good
but can i do it without programming? i mean just by excel functions and menus? how?
thanks
 
Upvote 0
It's possible, yes, though not straightforward.

Can I ask why VBA is not an option for you?

Also, is this a one-off exercise? I can simply give you the values if you want (there're only 120).

Regards
 
Upvote 0
Restricted to native Excel, I would put the formula =MOD(ROW(A10),10)+1 in A2 and =INT(ROW(A10)/10) in B2.
Dragged down 100 rows, that would give pairs of numbers 1,1 2,1 3,1 ... 1,2 2,2 .... 10,10

Then in C1, put the formula =COLUMN(A1) and drag right to L1, which gives 1 2 3 ... 10

Then in C2, put the formula =$A2*$B2*C$1 and drag it down and right to L1001.

The results of that last formula are the products that you seek.
 
Upvote 0
@PGC

Nice. This alternative will also produce the same results as yours, I believe:

=PRODUCT(1+MID(TEXT(ROWS($1:1)-1,"000"),{1,2,3},1))

Regards
 
Upvote 0
@PGC

Nice. This alternative will also produce the same results as yours, I believe:

=PRODUCT(1+MID(TEXT(ROWS($1:1)-1,"000"),{1,2,3},1))

Regards

Hi

Yes, I believe it will. For the set 1-10 your formula is preferable, much simpler.

For another set instead of 1-10, for ex. if the elements are 1-5 or 1-8, in my formula one just replaces the 10 with the upper bound of the interval.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

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