solver how to get the average of 9 with 5 number

jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
384
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
Hi friends i have this numbers:

5,6,7,8,9,10

wich is the combinations of these numbers that give me an average of 9, (the numbers can repeated)

sample:

9+9+9+9+9= 45 / 5 = 9
10+10+10+7+8 = 45 / 5 = 9
10+10+9+8+8= 45 / 5 = 9

and with 5 numbers wich combination of numbers that give eman average of 8
and with 5 numbers wich combination of numbers that give eman average of 7
and with 5 numbers wich combination of numbers that give eman average of 6
and with 5 numbers wich combination of numbers that give eman average of 5

thanks
 
did you read post #7 ?!

here is for 5,6,7,8,9
with parts of the table because it has 1556 records

5​
5​
5​
5​
5​
5​
5​
8​
5​
7​
5​
6​
5​
8​
5​
6​
6​
6​
7​
5​
5​
8​
5​
6​
5​
8​
6​
6​
5​
6​
5​
8​
6​
5​
6​
6​
9​
5​
5​
6​
5​
6​
7​
5​
5​
5​
8​
6​
8​
10​
5​
6​
6​
7​
6​
6​
8​
10​
5​
7​
6​
5​
9​
7​
8​
7​
6​
5​
9​
6​
9​
7​
9​
6​
7​
10​
8​
8​
9​
6​
10​
5​
10​
8​
9​
6​
5​
10​
10​
8​
9​
6​
10​
6​
9​
8​

8​
5​
10​
10​
7​
8​
8​
5​
10​
9​
8​
8​
8​
6​
7​
9​
10​
8​
8​
6​
7​
10​
9​
8​
10​
8​
10​
10​
7​
9​
10​
8​
10​
9​
8​
9​
10​
10​
8​
10​
7​
9​
10​
10​
8​
9​
8​
9​
10​
10​
9​
7​
9​
9​
10​
10​
9​
6​
10​
9​
10​
10​
8​
8​
9​
9​

Code:
[SIZE=1]let

    Source = {5,6,7,8,9,10},
    ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Add1 = Table.AddColumn(ToTable, "Custom", each Query2),
    Expand1 = Table.ExpandTableColumn(Add1, "Custom", {"Column1"}, {"Column1.1"}),
    Add2 = Table.AddColumn(Expand1, "Custom", each Query2),
    Expand2 = Table.ExpandTableColumn(Add2, "Custom", {"Column1"}, {"Column1.2"}),
    Add3 = Table.AddColumn(Expand2, "Custom", each Query2),
    Expand3 = Table.ExpandTableColumn(Add3, "Custom", {"Column1"}, {"Column1.3"}),
    Add4 = Table.AddColumn(Expand3, "Custom", each Query2),
    Expand4 = Table.ExpandTableColumn(Add4, "Custom", {"Column1"}, {"Column1.4"}),
    Average = Table.AddColumn(Expand4, "Average", each List.Average({[Column1], [Column1.1], [Column1.2], [Column1.3], [Column1.4]}), type number),
    ChTpText = Table.TransformColumnTypes(Average,{{"Average", type text}}),
    FilterDot = Table.SelectRows(ChTpText, each not Text.Contains([Average], ".")),
    CHTpNum = Table.TransformColumnTypes(FilterDot,{{"Average", Int64.Type}}),
    SortAsc = Table.Sort(CHTpNum,{{"Average", Order.Ascending}})
in
    SortAsc[/SIZE]

in PowerQuery Editor open Advanced Editor and paste code copied from here
 
Last edited:
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I forgot...
first you need do this, name it as Query2
Code:
[SIZE=1]
let
    Source = {5,6,7,8,9,10},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    #"Converted to Table"[/SIZE]
then post above (#11)
 
Last edited:
Upvote 0
you need to decide which one is correct for you because they are completly different
 
Upvote 0
@sandy666 not luck, downloaded power query, installed, and tell me Excel 2016 have power query, i go to data tab, but not see..

how to activate it?

thanks
 
Upvote 0
gt.jpg


what real version of excel do you have?
 
Upvote 0

Forum statistics

Threads
1,216,128
Messages
6,129,033
Members
449,482
Latest member
al mugheen

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