Different combinations of cells should take a specific value

Aleksei

New Member
Joined
Jun 27, 2018
Messages
4
Hi all,

I have a column of data (10 cells) and I need to do the following: I want different combinations of cells in each following column take a value of "0". So in the first 10 columns - every different cell takes "0" value, then in the following columns there must be already 2 cells with "0" value (all the possible combinations of 10), then the number of "0" values in each combination increases to 3 and etc. (till 9 of them are equal to "0").
Do you guys know how one could do it in Excel? Is there maybe some formula or code in VBA?

Thank you in advance.

Best regads,
Aleksei
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,

haha not really. I'm trying to do Mean-Variance Analysis. There I have to assign weight to each asset in a portfolio. My aim is to consider portfolios with all the possible combinations of assets. I want to gradually exclude assets from the list (assign "0" weight to them). That's what I'm doing :)
 
Upvote 0
I can't help you right now, am about to leave for a fortnight
A tip, try using the WorksheetFunction.COUNTIF() for each row and count the ocurrences of "0" or 0 that would help with the 2 3 4 etc allowed.
HAppy coding.
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,851
Members
449,194
Latest member
HellScout

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