Can you tell us what you're trying to do? Because this really isn't simple and without knowing why you want to do this it's hard to answer in a way that will get you what you want. Can you tell us how you want that to be highlighted? | A | 1 | 3 | 2 | 2 | 3 | 3 | Should they all be highlighted as A1+A2 = 5 & A2+A3 = 5? Or should it just be A1 and A2, and not A3 because 5 has already been reached? How should this be highlighted? | A | 1 | 3 | 2 | 4 | 3 | 1 | 4 | 2 | 5 | 1 | 6 | 5 Answer from serotones on reddit.com
🌐
YouTube
youtube.com › watch
Using Excel To Identify Entries That Add To A Specific Value.mp4 - YouTube
Have you ever encountered a large number of transactions and needed to find which of those transactions added to a specific amount? If so, then you've likely...
Published   October 25, 2011
🌐
Stack Overflow
stackoverflow.com › questions › 48572027 › using-excel-to-identify-entries-that-add-to-a-specific-value
Using Excel to Identify Entries that Add to a Specific Value - Stack Overflow
February 2, 2018 - I have a large list of numbers and would like to identify the different combinations that add up to another certain amount. I have tried installing the solver add in but for some reason it won't ap...
Discussions

How can I identify which cells sum to give a specific total from a list of numbers?
u/kiranpatel99 - Your post was submitted successfully. Once your problem is solved, reply to the answer(s) saying Solution Verified to close the thread. Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post. Include your Excel version and all other relevant information Failing to follow these steps may result in your post being removed without warning. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/excel
10
5
July 28, 2023
Find the sum of a specific value within multiple values
Hi, In our firm, we use one spreadsheet listing all invoices submitted under each separate project, sometimes the client transfers a lumpsum and we need... More on techcommunity.microsoft.com
🌐 techcommunity.microsoft.com
3
0
March 12, 2023
Looking for a specific sum within a range of numbers...
Is there a way to find out if certain cells within a range sum up to a specific number? I often find myself looking for a certain amount - like I've got an error for a specific dollar amount - but I have a range of entries, and any combination of those numbers could sum up to the total of the... More on mrexcel.com
🌐 mrexcel.com
6
0
May 17, 2003
How to find numbers that sum up to a value (with a big data base)
u/wintereveluv - Your post was submitted successfully. Once your problem is solved, reply to the answer(s) saying Solution Verified to close the thread. Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post. Include your Excel version and all other relevant information Failing to follow these steps may result in your post being removed without warning. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/excel
12
3
November 9, 2021
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Identifying Excel Entries that Add Up to a Specific Value or close to it. | MrExcel Message Board
July 13, 2020 - I have a set of random amounts in a spreadsheet and I need to determine which ones add up to a 430,20 or close to it?
🌐
Excel Forum
excelforum.com › excel-general › 540388-find-values-that-add-up-to-certain-amount.html
find values that add up to certain amount
>I have a long list of monetary amounts listed on an excel spreadsheet. I >am > trying to find combinations of those amounts that add up to certain larger > sums. For example on a smaller scale: > 10 > 15 > 21 > 41 > 53 > How can I find the cells that add up to 108? Is there a formula or > function > I can use on a large scale for this type of thing? ... Hmm, I just tried that link and I was denied access to it by my work pc. "Peo Sjoblom" wrote: > You can use solver, > > there was a similar question a few days ago, here's a link > > http://tinyurl.com/pfswm > > > note that the solver that comes with excel is limited in how large data set > you can use > > > -- > > Regards, > > Peo Sjoblom > > http://nwexcelsolutions.com > > > > "Joshua Jacoby" <[email protected]> wrote in message > news:[email protected]...
🌐
Reddit
reddit.com › r/excel › how can i identify which cells sum to give a specific total from a list of numbers?
r/excel on Reddit: How can I identify which cells sum to give a specific total from a list of numbers?
July 28, 2023 -

i.e in the most simple example, if I have the following list of cells:

A1 - 3 A2 - 2 A3 - 3

How can I highlight which cells produce the sum of 5?

Top answer
1 of 2
24

It's possible with the Solver add-in*. The following steps worked for me in Excel 2007 and 2010.

  1. Designate a cell to hold the result (C1 for this example) - this is the target cell, and a column that excel can use for scratch-work (B1:B100 for this example)
  2. In the target cell, enter the formula "=SUMPRODUCT(A1:A100,B1:B100)" (no quotes). This will calculate the sum of A1*B1+A2*B2+...etc
  3. Select Open the solver (Data tab, Analysis group)
  4. The target cell should be obvious (1 for this example)
  5. For 'Equal To:' select 'Value of:' and enter the desired value
  6. In the 'By Changing Cells' enter "1:100" (no quotes, and it may be necessary to initialize these values to 0 yourself)
  7. Add a constraint to the cells that can be changed. In the pull-down, select 'bin' (Binary). This restricts the values of these cells to 0 (removing the corresponding A cell from the sum) or 1 (adding the corresponding A cell to the sum).
  8. Click 'Solve' and wait. The numbers that are part of the subset you're looking for will have a 1 in the B column


If the solver is taking a long time, you can help it out by removing rows that obviously won't work (total is in dollars, and only one row has nonzero cents)


Bonus: You can have excel automatically highlight the cells that you're looking for by adding conditional formatting to those cells. Select all of the cells you want to format and from (Home tab)>>(Styles group)>>Conditional formatting>>New Rule select 'Use a formula to determine which cells to format'. In the formula, enter '=$B1=1' (no quotes) which will evaluate to true if the corresponding row in the B column is 1. For the format, you can add whatever you want (bold, italic, green fill, etc).

Another easy way to find the important rows is to sort column B Z->A, and all the 1's will come to the top.


*The solver add-in can be installed with these steps

  1. Click the Microsoft Office Button, and then click Excel Options.
  2. Click Add-Ins, and then in the Manage box, select Excel Add-ins.
  3. Click Go.
  4. In the Add-Ins available box, select the Solver Add-in check box, and then click OK. (If Solver Add-in is not listed in the Add-Ins available box, click Browse to locate the add-in.)
  5. If you get prompted that the Solver Add-in is not currently installed on your computer, click Yes to install it.
2 of 2
2

There is a low cost Excel Add-in SumMatch, which will highlight the subset of numbers that add up to a target sum.

🌐
The Daily CPA
thedailycpa.com › identifying-excel-entries-that-add-up-to-a-specific-value
Identifying Excel Entries that Add Up to a Specific Value – The Daily CPA
February 7, 2022 - A task that would take so long using trial and error now takes minutes thanks to the Solver Add-in. For more helpful excel hints, you might want to check out this pamphlet. It lists out all of the important tips and tricks you need to get the most out of Excel. If you are looking to figure out how to use excel to help in identifying excel entries that add up to a specific number, you need to do one thing first.
🌐
Microsoft Community
techcommunity.microsoft.com › microsoft community hub › communities › products › microsoft 365 › excel
Find the sum of a specific value within multiple values | Microsoft Community Hub
March 12, 2023 - Hi, In our firm, we use one spreadsheet listing all invoices submitted under each separate project, sometimes the client transfers a lumpsum and we need...
Find elsewhere
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Looking for a specific sum within a range of numbers... | MrExcel Message Board
May 17, 2003 - I often find myself looking for a certain amount - like I've got an error for a specific dollar amount - but I have a range of entries, and any combination of those numbers could sum up to the total of the error. I've tried selecting various cells with the hopes that I can randomly pick the right ones, but that's just hit or miss, and depending on how many cells (amounts) are involved, it could be impossible. Is there a formula or add-in that can check a range of numbers to see if any combination will sum up to a specific amount? (I'm using Excel 2000) Thanks!
🌐
Ablebits
ablebits.com › ablebits blog › excel › excel macro › find all combinations of numbers that equal a given sum in excel
Find all combinations of numbers that equal a given sum in Excel
July 21, 2023 - Finding combinations of values that add up to a given sum is a common problem in data analysis. For example, you may want to know all possible combinations of items that can be purchased with a given budget, or all possible ways to allocate resources to meet certain requirements. In this article, we will explore how to use Excel Solver and VBA to accomplish the task.
🌐
Reddit
reddit.com › r/excel › how to find numbers that sum up to a value (with a big data base)
r/excel on Reddit: How to find numbers that sum up to a value (with a big data base)
November 9, 2021 -

I have 100 numbers from 400 to 3500 and need to fund which numbers that, if you sum up, gives me a total of 3320.

Example: 2 + 3 = 5 (need to find the numbers 2 and 3 on excel)

I used the formula Solver but the problem is that it takes ages, I used on my sheet and it's has been more than an 1 hour and it's still processing!!!. It stopped twice and this is my third time trying it.

Is there a faster way? Or any online site that does that? I need to finish the report by tomorrow and have no clue... the numbers 400 to 3500 are values ($). Any help is appreciated

🌐
Quora
quora.com › How-can-I-quickly-identify-which-values-in-one-column-add-up-to-a-specific-value-or-values-in-Excel
How to quickly identify which values in one column add up to a specific value (or values) in Excel - Quora
Answer: Typically, I see this kind of question asked when someone wants to match a payment check to a column of invoices. This is actually a fairly hard problem to solve, so you won’t see any formula or simple macro that gives the answer. But if you have fewer than 200 values in the column, you ...
🌐
Reddit
reddit.com › r/excel › how to find all combinations that equal a given sum?
r/excel on Reddit: How to find all combinations that equal a given sum?
March 3, 2020 -

I am trying to see which numbers out of a list, equal the sum of $1039.70

How do I accomplish this?

Top answer
1 of 7
14
Solver is a great way to do this: https://thedailycpa.com/2017/07/21/identifying-excel-entries-that-add-up-to-a-specific-value/
2 of 7
4
For fun, I wrote horribly inefficient VBA that will provide you the index of numbers which will sum to your total, however in this case there is never an exact match to $1039.70 ($1039.88 is closest as someone else mentioned). Posting this code for fun (WARNING: again, this code is not efficient, it will duplicate answers if they are in a different order, you can play with adding or removing numbers at your own peril!): Option Explicit Public Sub FindCombinationOfSums(sumToFind As Double) Dim c As New Collection With c .Add 59.56 .Add 144.41 .Add 457.1 .Add 5.13 .Add 10.92 .Add 10.92 .Add 5.13 .Add 129.95 .Add 129.95 .Add 129.95 .Add 384.47 .Add 576.6 .Add 576.6 .Add 395.98 .Add 84.21 .Add 608.6 End With DeterminePaths c, sumToFind End Sub Public Sub DeterminePaths(c As Collection, sumToFind As Double, Optional pos As Long = 1, Optional ByVal sum As Double = 0, Optional ByVal curPath As String = "#") If sum = sumToFind Then MsgBox "Winner: " & curPath Exit Sub ElseIf (sumToFind - 0.2) <= sum And sum <= (sumToFind + 0.2) Then Debug.Print curPath, sum 'print close answers to immediate window Exit Sub ElseIf sum > sumToFind Then Exit Sub End If Dim lngLoop As Long For lngLoop = pos To c.Count If InStr(curPath, "#" & lngLoop & "#") = 0 Then DeterminePaths c, sumToFind, pos + 1, (sum + c(lngLoop)), curPath & lngLoop & "#" End If Next lngLoop End Sub
🌐
Reddit
reddit.com › r/excel › find a specific value from a list of different values by adding 2 or more values in the list
r/excel on Reddit: Find a specific value from a list of different values by adding 2 or more values in the list
October 6, 2024 -

I don't know if there is a way to do this in Excel but trying to do it manually is most time consuming. I am under a deadline to reconcile payments. For example, I have a value of $69.05 that was billed but is made up of multiple items. I am trying to find the amounts from the list that add up to $69.05. I would love to be able to automate this!

🌐
Quora
quora.com › How-can-an-IF-statement-be-used-in-Excel-to-add-a-specific-value-when-certain-criteria-are-met
How can an IF statement be used in Excel to add a specific value when certain criteria are met? - Quora
Answer: That’s exactly what an =if() statement does. That’s what it’s for. If you want to add 10 to a number in cell a1 if the value of cell b1 is less than 0 and place the result in c1, then the formula in c1 is: =if( b1
🌐
Microsoft Support
support.microsoft.com › en-us › office › use-excel-as-your-calculator-a1abc057-ed11-443a-a635-68216555ad0a
Use Excel as your calculator - Microsoft Support
Or use the AutoSum feature to quickly total a series of values without entering them manually in a formula. After you create a formula, you can copy it into adjacent cells — no need to create the same formula over and over again. ... All formula entries begin with an equal sign (=).
🌐
ExtendOffice
extendoffice.com › documents › excel › how to find all combinations that equal a given sum in excel?
How to find all combinations that equal a given sum in Excel?
March 18, 2025 - In this article, we will explore various methods to pinpoint the specific combinations of numbers within a list that total a designated value in Excel.
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Solver: Can it do this? Find the numbers that add closest to the target number. If so, how? | MrExcel Message Board
September 22, 2015 - If you can follow that example, then 1. Change the objective function to calculate the square of the difference between the sum and the target value i.e., (=(target - sum)^2), and 2. Change the Solver model to minimize that value (versus making it zero) ... Giving this a try. I'll brb. ... You're the best! I changed the following settings: -Make unconstrained variables non-negative (checked) -Select a solving method: GRG Nonlinear i pressed ESC since it was running for awhile and excel gave the optimum answer, which was more than reasonable.
🌐
AccountingWEB
accountingweb.co.uk › any-answers › excel-find-me-the-numbers-that-add-up-to-this
Excel - 'find me the numbers that add up to this'? | AccountingWEB
June 13, 2012 - You can use the SOLVER add-in however I think it only gives you the first combination of numbers that sum to your target value. 50+ transactions may be a problem because there is 2 ^ (50) combinations of numbers that need to be summed and checked against your total. There is a shareware add-in SumMatch for Excel that may help:
Top answer
1 of 2
1

I have managed to make a VBA solution for this. I have tested with multiple different goals/targets & different range of numbers to sum and worked every time. Can't guarantee there isn't a problem it won't work around though.

Here it is:

Note - you should be able to now have multiple of the same number. This will only return the first solution it finds. It doesn't find EVERY solution.

Sub SumSolver()

Dim rng, Goal As Double, ws As Worksheet, i As Long, j As Long, Answer As Double, k As Long
Dim lRow As Long, Answerlist As String, LastAdded As Long, AnswerListPos As String
Dim c As Range, RngToSplit As String, AnswerArray, AnswerItem

Set ws = Sheets("Sheet1") 'Change Sheet1 to your sheet name
lRow = ws.Range("B" & ws.Rows.Count).End(xlUp).Row 'Change to needed column
ws.Range("C2:C" & lRow).ClearContents 'Clear output range if needed

For Each c In ws.Range("B2:B" & lRow) 'This loop populates the list range into a string
    If c.Value <> "" Or Not IsNumeric(c.Value) Then 'Checking for empty or non-numeric values
        If RngToSplit = "" Then
            RngToSplit = c.Value
        Else
            RngToSplit = RngToSplit & "," & c.Value
        End If
    End If
Next
rng = Split(RngToSplit, ",") 'Split the new list string into an array

If Not IsNumeric(ws.Range("A2").Value) Then 'Checks target value is actually a number
    MsgBox "The target value is not a valid number. Please correct this before trying again.", vbExclamation, "Sum Solver"
    Exit Sub
Else
    Goal = ws.Range("A2").Value 'Value of the goal/target
End If

For i = 0 To UBound(rng) ' 0 = start of array, Ubound = End of array
    If rng(i) = Goal Then
        ws.Range("C2") = rng(i)
        Answerlist = rng(i)
        GoTo SubExit
    ElseIf rng(i) < Goal Then
        Answer = rng(i)
        Answerlist = rng(i)
        AnswerListPos = i
        For j = i + 1 To UBound(rng)
            If Answer + rng(j) = Goal Then
                Answerlist = Answerlist & "," & rng(j)
                AnswerListPos = AnswerListPos & "," & j
                GoTo SubExit
            ElseIf Answer + rng(j) < Goal Then
                Answer = Answer + rng(j)
                LastAdded = j
                If Answerlist = "" Then
                    Answerlist = rng(j)
                    AnswerListPos = j
                Else
                    Answerlist = Answerlist & "," & rng(j)
                    AnswerListPos = AnswerListPos & "," & j
                End If
            End If
            If j = UBound(rng) Then
                If LastAdded = UBound(rng) Then
                    Answerlist = Left(Answerlist, InStrRev(Answerlist, ",") - 1)
                    AnswerListPos = Left(AnswerListPos, InStrRev(AnswerListPos, ",") - 1)
                    Answer = Answer - rng(j)
                    LastAdded = Val(Mid(AnswerListPos, InStrRev(AnswerListPos, ",") + 1))
                End If
                If LastAdded > 0 Then Answer = Answer - rng(LastAdded)
                If InStr(Answerlist, ",") = 0 Then Exit For
                j = Val(Mid(AnswerListPos, InStrRev(AnswerListPos, ",") + 1))
                Answerlist = Left(Answerlist, InStrRev(Answerlist, ",") - 1)
                AnswerListPos = Left(AnswerListPos, InStrRev(AnswerListPos, ",") - 1)
            End If
        Next j
    End If
    Answerlist = ""
Next i

SubExit:

If Answerlist <> "" Then
    i = 2
    AnswerArray = Split(Answerlist, ",") 'Split the result into an array
    For Each AnswerItem In AnswerArray
        ws.Range("C" & i) = AnswerItem 'Output the results into the sheet
        i = i + 1
    Next
Else
    MsgBox "No possible combination found for a target value of " & Goal & ".", vbExclamation, "Sum Solver"
End If

End Sub

EDIT: Just updated to account for if there are any blank rows in the list range as well as handle if a value is non-numeric. Actually made it half a second faster (13s) for a 12 item list of 1000 iterations.

You will see the rows I've made comments on are the ones you need to change. Pretty much just what columns it is working on and the starting cell It works looking at the last row but if you don't need it then just replace for example "B2:B" & lRow with B2:B5 etc.

I've also incorporated it into a function. Used as:

=SumSolver(Target value, Range of sum values)

It returns the results in the same cell separated by a comma. This can be changed to another method easily if needed though.

Function SumSolver(Goal As Double, ListRange As Range)

Dim i As Long, j As Long, Answer As Double, k As Long, rng As Variant
Dim Answerlist As String, LastAdded As Long, AnswerListPos As String

rng = Application.Transpose(ListRange)

For i = 1 To UBound(rng)
    If rng(i) = Goal Then
        Answerlist = rng(i)
        GoTo SubExit
    ElseIf rng(i) < Goal Then
        Answer = rng(i)
        Answerlist = rng(i)
        AnswerListPos = i
        For j = i + 1 To UBound(rng)
            If Answer + rng(j) = Goal Then
                Answerlist = Answerlist & "," & rng(j)
                AnswerListPos = AnswerListPos & "," & j
                GoTo SubExit
            ElseIf Answer + rng(j) < Goal Then
                Answer = Answer + rng(j)
                LastAdded = j
                If Answerlist = "" Then
                    Answerlist = rng(j)
                    AnswerListPos = j
                Else
                    Answerlist = Answerlist & "," & rng(j)
                    AnswerListPos = AnswerListPos & "," & j
                End If
            End If
            If j = UBound(rng) Then
                If LastAdded = UBound(rng) Then
                    Answerlist = Left(Answerlist, InStrRev(Answerlist, ",") - 1)
                    AnswerListPos = Left(AnswerListPos, InStrRev(AnswerListPos, ",") - 1)
                    Answer = Answer - rng(j)
                    LastAdded = Val(Mid(AnswerListPos, InStrRev(AnswerListPos, ",") + 1))
                End If
                If LastAdded > 0 Then Answer = Answer - rng(LastAdded)
                If InStr(Answerlist, ",") = 0 Then Exit For
                j = Val(Mid(AnswerListPos, InStrRev(AnswerListPos, ",") + 1))
                Answerlist = Left(Answerlist, InStrRev(Answerlist, ",") - 1)
                AnswerListPos = Left(AnswerListPos, InStrRev(AnswerListPos, ",") - 1)
            End If
        Next j
    End If
    Answerlist = ""
Next i

SubExit:

If Answerlist <> "" Then
    SumSolver = Answerlist
Else
    SumSolver = "N/A"
End If

End Function

Example:

I decided to do an update of my speed test. This time comparing the updated code against my original, and was surprised to see the difference. I did runs of 1000 iterations where the solver could not find a combination. I did this with screen updating on. For a list of 8 there is a max of 255 combinations, for a list of 12, there is a max of 4095 combinations (doubles with each item added). For a list of 12, that comes to 4,095,000 calculations. Updated code did that in an average of 13.6 seconds. Obviously this is on my machine, which will have different results to yours (but the ratios should still be about the same).

2 of 2
0

So, just like this:

=sumproduct(C5:C10,D5:D10)

is the formula in cell B8 and is the objective in the Solver.

The two constraints control the model and DO check the options to make sure "Ignore Integer" is NOT selected.

Binary is used as this is a selected or not selected situation.

I used equal to in the constraint, but in some situations you may need to use <= or >= as there may not be an exact solution.

The Solver also deals with multiple values the same, unlike the other answer, however, as there are multiple solutions then which ones are picked are random: