Gå til hovedindhold

Find nemt alle kombinationer, der svarer til en given sum i Excel

Kutools til Excel

Forøger Excel med 300+
Kraftfulde funktioner

Antag at der er en liste med tal (heltal, decimaltal eller negative tal), og nu vil du finde alle mulige kombinationer fra disse tal, der svarer til en given sum. Normalt kan du bruge formler, Solver-tilføjelsesprogram eller brugerdefineret funktion til at opnå det, men det er tidskrævende og ikke let at håndtere. Her med det nyttige Sæt et nummer op nytte af Kutools til Excelat finde alle kombinationer, der svarer til et givet beløb, har aldrig været så let i Excel.

Find alle kombinationer, der svarer til en given sum


Find alle kombinationer, der svarer til en given sum

Som vist nedenstående skærmbillede, for at finde alle mulige kombinationer af tal i område B3: B11, der summerer sig til 520, kan du prøve med hjælpeprogrammet Make Up a Number som følger.

1. klik Kutools > Indhold > Sæt et nummer op.

skud udgør et nummer 03

2. i Sæt et nummer op dialogboksen, skal du udføre nedenstående indstillinger.

  • I Datakilde boks, vælg nummerlisten for at finde hvilke numre der tilføjes op til 520;
  • I Indstillinger sektion, indtast 520 i Sum tekstboks;
  • Klik på knappen OK knap. Se skærmbillede:

3. I den næste Sæt et nummer op dialogboks, skal du vælge en celle for at output kombinationerne og klikke på OK knap. Så a Kutools til Excel dialogboks vises for at fortælle dig, hvor mange kombinationer der oprettes, klik OK.

Du kan se alle mulige kombinationer af valgte numre, der summerer op til 520, er vist som følger.

Noter:

1. Det er valgfrit at angive antallet af kombinationer og antallet af elementer i hver kombination i stedet for at generere alle kombinationer. Som vist nedenstående skærmbillede kan du angive antallet af kombinationer som 4 og angive antallet af elementer i hver kombination fra 1 til 4, så får du følgende resultat:

Resultat:

2. Denne kraftfulde funktion kan også anvendes til decimaler og negative tal, se skærmbillede:

Og du får resultatet som vist nedenstående skærmbillede:

3. Du kan tjekke Gem i et nyt ark for at udføre kombinationerne til et nyt ark.


Find alle kombinationer, der svarer til en given sum

Kutools til Excel indeholder mere end 300 praktiske Excel-værktøjer. Gratis at prøve uden begrænsning på 30 dage. Download den gratis prøveperiode nu!


Produktivitetsværktøjer anbefales
Følgende værktøjer kan i høj grad spare din tid og penge, hvilken er den rigtige for dig?
Office-fanen: Brug af praktiske faner på dit Office, som vejen for Chrome, Firefox og New Internet Explorer.
Kutools til Excel: Mere end 300 avancerede funktioner til Excel 2021, 2019, 2016, 2013, 2010, 2007 og Office 365.

Kutools til Excel

Den ovenfor beskrevne funktionalitet er kun en af ​​300 kraftfulde funktioner i Kutools til Excel.

Designet til Excel(Office) 2021, 2019, 2016, 2013, 2010, 2007 og Office 365. Gratis download og brug i 30 dage.

Skærmbillede af Kutools til Excel

btn læs mere      btn-download     btn køb

Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Is it possible to consider repetition of the same number as well?
For example:
numbers: 10 - 20 - 40
Given number: 90

Combination: 40 - 40 - 10

Thank you!
This comment was minimized by the moderator on the site
Hi Giuseppe,

Sorry for the inconvenience. If your original data doesn't contain any duplicates, then duplicate values cannot be generated from it. Creating duplicate values for the same number would result in numerous combinations, which is generally not advisable due to complexity.
This comment was minimized by the moderator on the site
I do not know about others, but I still have it.
This comment was minimized by the moderator on the site
There is no "Make up a number" under Content in my Kutools, has this feature been removed?
This comment was minimized by the moderator on the site
Hi Alex Ramaker,
I am sorry for the inconvenience. Can you tell me which Kutools version are you using? If you can't find it under the Content group, please press the Alt + S keys to open the Kutools search box and type in "Make up a number", and then the feature name will be listed under the search box. Just click on it to activate the feature.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/make_up_a_number.png
This comment was minimized by the moderator on the site
I am also missing features in the Content section including Make Up a Number and Data Association and using Alt + S does not give me an option to search functions. Version is 19.0. Kutools was downloaded to my work machine through my organization's catalog, is it possible certain features are blocked?
This comment was minimized by the moderator on the site
Hi Sylvia,

The Make Up a Number feature was released in version 23.00 and the Data Association feature was released in version 25.00.
You are using an old version of Kutools and It’s the lifetime license with the 2-year free update support.
After the 2-year free update support, you cannot update to any new versions but you can still use the old versions of the software.
After the 2-year free update support, you will need to purchase a new version to use the features in the new version.
This comment was minimized by the moderator on the site
The bug has not been fixed yet. Even though I select one output, and wait forever for the answer, I still get an error message stating that the tool can't handle more than 1,600+ answers. I did not ask for that many, I asked for *one*.
This comment was minimized by the moderator on the site
Hi Cathy,
Sorry for the convenience and thanks for your support.
Our developers are working on upgrading this feature to have a better and fast way to deal with big data. And the new version will be released soon.
Please stay tuned for our updates!
This comment was minimized by the moderator on the site
Was the bug fixed? What was great? Thank you.
This comment was minimized by the moderator on the site
This is so great, Thanks
This comment was minimized by the moderator on the site
Same here. The function gets hung-up when searing more than 1000 numbers. I do see a progress bar, but it continues to get stuck at 6%. I have been using their products for close to a decade; it would be nice if they fixed/improved this. I was told to install latest version. I wouldn't know how to install anything other than the latest version.
This comment was minimized by the moderator on the site
Hi Tony,
Sorry for the convenience and thanks for your support for close to a decade.
Our developers are working on upgrading this feature to have a better and fast way to deal with big data, and it will be avaliable in the next release.
By the way, do the 1000+ numbers you used include positive numbers, negative numbers and decimal numbers? Do you mind send us the sample file for testing via ?
This comment was minimized by the moderator on the site
Anyone able to get this to work? The Processing please wait is taking forever.. Don't want to cancel

This comment was minimized by the moderator on the site
I'm having this problem! Did you get it to work?
This comment was minimized by the moderator on the site
instead of "processing, please wait" it needs to have a counter which displays either how much time is estimated to be remaining to calculate or an actual counter of the calculations done and remaining to be counted. ie i have waited over 4 hours for the program to work out my 44C8 query (177m combinations) but i don't know whether the program has crashed or is still calculating.
This comment was minimized by the moderator on the site
Still going after another 6 hours (10hrs all up). i assume it has crashed and will force close the program.
This comment was minimized by the moderator on the site
ok just tried a 35C8 and it took just over 90mins, so maybe 44C8 takes 11.5hrs.
This comment was minimized by the moderator on the site
È possibile escludere delle combinazioni da quelle trovate ?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations