LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 419
Default XL 2003: How do I get every possible combination?

Cross-posted:
- microsoft.public.excel.programming
- microsoft.public.excel.worksheet.functions




Hello all,

I'm looking for an XL solution and/or a VBA solution...and I just can't wrap
my head around this.

I have a list of 162 numbers (loan amounts: min = $0, max = $3,107,000).

I want to find the sum of every single combination of the 162 numbers...from
one single number up to all 162 numbers. If my calculations are correct,
that is 26,244 different sums.

For VBA, I'm guessing I'm gonna need 2 for loops...one nested inside the
other. But I can't figure out the code to sum up all the different
combinations. Something like this:


For plngIndexX = LBound(pdblArray) To UBound(pdblArray)
For plngIndexY = LBound(pdblArray) To UBound(pdblArray)
'code to calculate all the differnt combinations
Next plngIndexY
Next plngIndexX


In XL, trying to think like a computer...I'm gonna need 162 bits(cells) to
calculate. But instead of each bit having a progressive value of a power of
2, each bit will be one of the numbers in my list. I was thinking of using
the list of numbers as column headers across the top, have a sumproduct
formula in column 163/164 that will sum up the column headers according to
the bits being on or off, and then have 26,000+ rows of bits marked on or
off. The problem would be filling out those 26,000 rows with 1's & 0's.
Anyone know of formulas or code that I could use to mark my bits on or off?

If it would be easier/faster in MS Access/SQL Server, I'm all ears.

Thanks for any help anyone can provide,

Conan Kelly



---------------------------
"Smokin' weed kills your brain cells. Drinkin' only screws up your
liver...ya got 2 a those."
- Earl Hickey (NBC's "My Name is Earl")


If Milli Vanilli falls in the woods, does someone else make a sound?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL 2003: How do I get every possible combination? Conan Kelly Excel Worksheet Functions 14 July 17th 09 05:09 PM
Excel 2003 - Combination chart: Stacked Column + Stacked Column Robyda Charts and Charting in Excel 4 August 24th 08 03:16 PM
Combination Sum [email protected] Excel Worksheet Functions 4 June 27th 08 03:56 PM
How do I make a combination chart in 2007 as in 2003? Ducky Charts and Charting in Excel 2 June 7th 07 01:02 AM
combination combination? Excel Discussion (Misc queries) 10 January 13th 07 04:08 AM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"