My sister, an accountant, asked me if I could whip something up for her to help her crunch some numbers. Four months later...
What she wanted specifically was a program that could be given a set of numbers and a target amount and find the combination of numbers in the set that equals (or gets really close to) the target. I said surely there must be something in Excel that can do this for you. Apparently not. (Although I know now that I've finished someone will immediately point me to the Excel formula that does it.) So I came up with a ingenious brute force attack that could handle all of 16 or 17 numbers. Her sample set had 27.
It turns out this is a variation on a well-known and somewhat complex class of math problems: combinatorial optimization. A little further research led me to some strategies for pseudo-polynomial (as opposed to exponential) time algorithms (as an English major, I'm very proud to say that and say it every chance I get.) Eventually I put together something that seems to do the job.