New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Combination of Number Issue

Macros, VBA, Excel Automation, etc.

Combination of Number Issue

Postby hksharmaa » Thu Dec 24, 2015 3:47 am

Hi All,

I have an issue. I have 4 Numbers from 1 to 4.
Minimum Colum will be 2 and Max. column should be 8
Now i a want all different combinations of these numbers to give sum of 8. The numbers can repeat in a column.
The highest number which i can plot in any column should be less than equal to 4 and minimum should be 1.



Like 1+1+1+1+1+1+1+1=8(8 Coulumns Max.)
1+1+1+1+1+1+2 =8
4+4 =8(2 Columns Min.)
1+2+3+2 =8
4+1+1+1+1 =8

Is there an method??
Please help.
  • 0

hksharmaa
Rookie
 
Posts: 2
Joined: Dec 24, 2015
Reputation: 0
Excel Version: 2010

Re: Combination of Number Issue

Postby NoSparks » Thu Dec 24, 2015 11:09 am

Now i a want all different combinations of these numbers to give sum of 8

1+1+1+1+4=8
1+1+1+4+1=8
1+1+4+1+1=8
1+4+1+1+1=8
4+1+1+1+1=8

How many different combinations is this ?
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010

Re: Combination of Number Issue

Postby Beamer » Fri Dec 25, 2015 2:19 am

I got 110 combinations

Maybe I misread :)
  • 0

You do not have the required permissions to view the files attached to this post.
Beamer
Excel Junkie
 
Posts: 217
Joined: Oct 3, 2014
Location: New South Wales, Australia
Reputation: 31
Excel Version: 2010

Re: Combination of Number Issue

Postby Beamer » Fri Dec 25, 2015 5:16 am

oops, sorry. I saw the duplicate post and followed back to this via OP's profile.
Didn't notice that it was a VBA question.
  • 0

Beamer
Excel Junkie
 
Posts: 217
Joined: Oct 3, 2014
Location: New South Wales, Australia
Reputation: 31
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 224 guests