Q: Ok my question title is not very good, but still . for the following songs, I try to find the value 14334.45 from a combination of adding two or more numbers. Is there a function that goes through the combination of all the songs that the song Im looking to find?
Thanks:)
3916
4950
4378
1650
4950
4950
4950
11850.35
11850.35
21821.8
21821.8
6095.53
2361.98
6231.57
2013.68
7986
5907
75323.6
13200
38709
-3589.92
6712.2
244741.8
7855.01
151421.6
49704.31
6204
621.5
19846.2
6966.3
20134.4
1870
148.5
98299.3
9771.3
1741.3
110701.38
The Three Money Raising Questions
Re:Sigh, thanks for trying, i really appeciate it… guess my problem is somewhere else, thanks!
52 Model Questions For Bible Teachers.
Re:I wrote a quick program to look for sums of those numbers that added up to your target. Adding the smallest ten terms is already too much, so you need a sum of nine terms or fewer.
My program didn't find any such sum that equaled your target. Sorry.
You're not trying to balance your checkbook by any chance, are you?
Jim
50 Home Business Clarity Questions
Re:You're only allowed to use each number (at most) once for each time it appears in the list? I don't know of any canned routine that does that already, but it shouldn't be too hard to build one yourself.
I'd start by sorting the list of numbers in increasing order, and then adding them up in order starting from the lowest until adding the next number would put the sum above your target. That should give you an upper limit on how many of the numbers you can use.
Then I'd make all the "two-sums," "three-sums," "four-sums," and so on, until I passed the limit.
Jim
Cfa Study Notes, Practice Questions
Re:Originally posted by: guy
I can't think of a way to coax a built-in function to do this, but you could use the following VBA function that I just hacked together:
Function PairEqual(Rng As Range, Target As Range) As Boolean
Dim i, j As Integer
For i = 1 To Rng.Count
For j = 1 To Rng.Count
If Rng.Cells(i) + Rng.Cells(j) = Target.Value Then
PairEqual = True
Exit Function
End If
Next j
Next i
End Function
Open the VBA Editor (Alt-F11) and insert a module into your workbook and then paste in that code. In your worksheet, use the function as: =PairEqual(A1:A37,G2). It will return either True or False depending on if it finds a match. Also, it only looks for the first match. You could modify the function if you need to identify the pair that works (if there is one).
I didn't find a pair that added up to your target value. That may be because it doesn't exist, or maybe your numbers are rounded.
Edit: Sorry, I just realized that you said to add two or more numbers. My solution only looks at every pair.
Thanks dude, i'll try this out when i get to work this morning
Hopefully the answer is in only a pair and not more!
Gold Standard Trivia Pub Quiz Questions and Answers
Re:I can't think of a way to coax a built-in function to do this, but you could use the following VBA function that I just hacked together:
Function PairEqual(Rng As Range, Target As Range) As Boolean
Dim i, j As Integer
For i = 1 To Rng.Count
For j = 1 To Rng.Count
If Rng.Cells(i) + Rng.Cells(j) = Target.Value Then
PairEqual = True
Exit Function
End If
Next j
Next i
End Function
Open the VBA Editor (Alt-F11) and insert a module into your workbook and then paste in that code. In your worksheet, use the function as: =PairEqual(A1:A37,G2). It will return either True or False depending on if it finds a match. Also, it only looks for the first match. You could modify the function if you need to identify the pair that works (if there is one).
I didn't find a pair that added up to your target value. That may be because it doesn't exist, or maybe your numbers are rounded.
Edit: Sorry, I just realized that you said to add two or more numbers. My solution only looks at every pair.
0 Comments.