Excel VBA - netting several amounts to zero

  • Thread starter Thread starter descartes
  • Start date Start date
D

descartes

I need a macro to analyse multiple numerical amounts in a column and
identify those amounts which sum to zero. For example, in the
following list, the 1st, 2nd and 5th amounts net to zero.

23.20
16.50
-85.60
-25.60
-39.70

The list of numbers can vary from as short as this list to many
hundreds. In a longer list I would need to see all items highlighted
which net to zero, leaving only all items which cannot be netted.

If anyone has any tips on how to accomplish this, I would appreciate
it.
 
little problem:
how to decide which amount you want to see netted?

20
-10
-3
-7
-2
-8

quite some different possibilities....
 
Seriously, a supercomputer. Finding those items from a list of "hundreds"
is well beyond the capabilities of your PC.

HTH,
Bernie
MS Excel MVP
 
Bernie Deitrick said:
Seriously, a supercomputer. Finding those items from a list of "hundreds"
is well beyond the capabilities of your PC.

HTH,
Bernie
MS Excel MVP

lol
though this may be an interesting coursework task for finding an
efficient algorithm :-)

Frank
 
Frank,

There are some really good algorithms that work well up to 20 to 30 items,
but beyond that they all start slowing down. I've never _really_ figured out
how the better ones work :-) so if you want to hold a course....

HTH,
Bernie
MS Excel MVP
 
Hi Bernie
I also stoped in this range of numbers - and I only remember them
distantly :-) -> for more complicated algorithmns I simply ask my
brother to implement them for me <vbg>

So I definetly won't hold a course ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top