View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default NEED MACRO TO GET BALANCE

On Jan 31, 9:23*pm, Dave D-C wrote:
I think this is what you want:

=IF(AND(B2="",C2=""),"",IF(A2<"","NOT
CORRECT",IF(C2<"",$A$1-C2,$A$1-B2)))

Give PaulR the credit -- he had it 3 or 4 threads ago.



K wrote:
I want a macro to calculate the balance in column D.
The Balance should be calculated as follows:


It should subtract the column C amount if there is one, and
if there is none then it should subtract the column B amount.
But if there is code in column A, then it should not subtract
anything but should put "NOT CORRECT" in column D.


FOR EXAMPLE:
*A2 = "G1"; B2 = 20; *C2 = 10


Now the macro should check that A2 has a code in it so it
should not subtract anything, but just put "NOT CORRECT" in *D2.


Note that if there is nothing in cell C2 and B2 then cell
D2 should show nothing.


I hope I have done my best to explain what I am trying to
say and achive.


If any of my online friends can come up with any formula
for column D, that will be good but please make sure that it
does all the work which I mentioned above.


Please, if anybody can give his precious time to sort out
my problem then I'll be very thankful- Hide quoted text -


- Show quoted text -


Thanks Dave i done little adjustment in your formula and i got what i
wanted. Thanks to Paul R as well for his help