Choosing Options out of array

moshiq

New Member
Joined
Nov 18, 2013
Messages
9
Hi guys,

I have a problem that I find hard to solve and I will thank you for you advise:

-I have X options and I need to pick 3 out of them for 1st, 2nd and 3rd place.
-Each option is valued as: rate*place probability.
-If I chose option A in the 1st place it's unavailable for the 2nd and 3rd place
-I need the 3 highest (in rate*probability) combinations of those options.

here is an example of 5 options (it can varies):

Price1st Place2nd Place3rd Place
3100%40%20%
490%50%35%
2.580%50%40%
3.570%60%50%
560%20%40%

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>

<colgroup><col><col><col><col span="2"></colgroup><tbody>
</tbody>

the solution to this example is:
1) B,D,E
2) D,B,E
3) B,A,E

What do you recommend I should do?
I prefer formula upon VBA.

Thanks
 
You're welcome!

Remember to get back to me re the point about identical totals if it becomes an issue.

Regards
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You're welcome!

Remember to get back to me re the point about identical totals if it becomes an issue.

Regards


You were right.

If the 1st and the 2nd values are equals, it shows the first string twice.


Another question (more important):

Can you teach me how to tweak the formula?
1. for have more than 5 products (let's say 7)
2. placing the table not from the first cell (A1)

Thanks again for your help.
 
Upvote 0
Hi,

A1 just needs to be replaced with whatever is the top-left (unused) cell in your table.

The formula for seven products would be (now assuming your table is in A1:D8):

=LARGE(MMULT(IF(MMULT(IFERROR(FIND({1,2,3,4,5,6,7},ROW($123:$765))^0,0),{1;1;1;1;1;1;1})=3,N(OFFSET($A$1,MID(ROW($123:$765),{1,2,3},1),{1,2,3})),0),{1;1;1}),ROWS($1:1))


You can compare this to the version for 5 products and hopefully work out what's happening.

Based on that formula for seven products, this new formula in G2 should eliminate the issue of duplicate totals:

=INDEX($A$2:$A$8,MID(INDEX(ROW($123:$765),SMALL(IF(MMULT(IF(MMULT(IFERROR(FIND({1,2,3,4,5,6,7},ROW($123:$765))^0,0),{1;1;1;1;1;1;1})=3,N(OFFSET($A$1,MID(ROW($123:$765),{1,2,3},1),{1,2,3})),0),{1;1;1})=$F2,ROW($123:$765)-MIN(ROW($123:$765))+1),COUNTIF($F$2:$F2,$F2))),COLUMNS($A:A),1))


Hope that helps.

Regards
 
Upvote 0

Forum statistics

Threads
1,215,497
Messages
6,125,157
Members
449,208
Latest member
emmac

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