View Single Post
  #1   Report Post  
Mr.Nemo Mr.Nemo is offline
Junior Member
 
Posts: 1
Default Excel Macro Programing Problem

Hello,

I have got a question regarding how to solve a problem using excel macro. Here it goes :

There are n=4 variables : x1,x2,x3,x4, each can take r=3 different values: A,B,C. See below:
X1 A1 B1 C1
X2 A2 B2 C2
X3 A3 B3 C3
X4 A4 B4 C4
The final equation to be computed is y=x1+x2+x3+x4. Now, there are nPr = 24 different values all the variables can assume and therefore there will be 24 different y values the above table and equation can generate.
Problem Statement: Generate a macro which will list all the y values when the values of n and r are supplied.

I would really appreciate is someone could help me out with the macro code.

Thanks in advance.