Add up to zero

B

Boss

I have two columns populated with numbers. Few numbers are positive and few
are negative.

I need to add these numbers together and bring the total to zero.

If total of any number of cells of column one is equal to the total of any
number of cells of second column then i

need to shade those cells.

I can do bit of coding in excel, please help me with a code or login to this
situation.
 
P

PJFry

Boss said:
I have two columns populated with numbers. Few numbers are positive and few
are negative.

I need to add these numbers together and bring the total to zero.
Are you saying that you need to force the total of A1:B1 to zero by changing
one of the two cells?
If total of any number of cells of column one is equal to the total of any
number of cells of second column then i

need to shade those cells.

Are you saying that if the value in cell A1 = B2 then shade both those cells?
I can do bit of coding in excel, please help me with a code or login to this
situation.

PJ
 
B

Boss

Hi,

Thanks for the reply... But what i want is something different.

Col A Col B
23 34
4456 4417
5687 39
56 234
235 567
-56 23

For example we have two columns Col A and Col B.

Now +56 in Col A should get shaded with -56 of Col A

and

+23 of Col A should get shaded with +23 of Col B
+4456 of Col A should get shaded with (4417+39) of Col B

I feel this as tuff, but please help me with some clue so that i can move
forward in coding.

Thanks!
Boss
 
P

PJFry

What you are looking to do is beyond my scope of experience.

The problem lies mainly in the second scenario. You will need to evaluate
each combination of numbers and compare that result with your target number.
In your example of +4456 of Col A should get shaded with (4417+39) of Col B,
you could have an instance of 4456 = (4410+46). How could you tell these
apart?

The first scenario could possibly be accomplished by looping through your
range and comparing each value that is not shaded to the target. If there is
a match, color the cell, if no match, continue looping. But rather than
coloring the cell, it may make more sense to flag a third column with a
number. That way you can sort on the 1, 2, 3, etc. While Excel 2007 can
sort on colors, it is easy to confuse red with an almost red shade.

Sorry I could not be more help.

--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.
 

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

Top