Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default NEED MACRO TO GET BALANCE

Hi, Please see the detail below which i got on my spreadsheet

# A B C D---------Coloumns
1 100---------------------------------Budget Amount in Cell A1
2 G1 20 10-----------------Data from Cell A2 to C6
3 30 03
4 SS 15
5 13 14
6 TT 18 19

i want macro to calculate balance in coloumn D cells. the Balance
should be calculated the
way that it should minus first coloumn C figure and if there is no
figure in coloumn C then it
should minus coloumn B figure but if there is code in coloumn A cell
then it should not minus
any of that row figure and should put text in coloumn D cell that "NOT
CORRECT" and then
carry on down to the next cell
FOR EXAMPLE: in row 2 there is code "G1" in cell A2 and figure 20 in
cell B2 and also figure
10 in cell C2. now macro should check that if there is nothing in cell
A2 then it should minus
first cell C2 figure but if there is nothing in cell C2 then it should
look in cell B2 and minus that
figure and give the balance in cell D2. but as above i have code "G1"
in cell A2 so now macro
should not minus any figure which are in cells C2 and B2 but just put
text in cell D2 that
"NOT CORRECT". and like this macro should carry on working down to
next cell.
Note: that if there is nothing in cell C2 and B2 then cell D2 should
show nothing.
I hope i done my best to explain what i am trying to say and achive.
If any of my online
friend can come up with any formula in coloumn D cell that will be
also good but please
make sure that it should do all the work which i mentioned above.
Please if anybody can
give his precious time to sort out my this problem then i'll be very
thankful
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default NEED MACRO TO GET BALANCE

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
show balance MG Excel Discussion (Misc queries) 2 April 24th 09 11:42 PM
running balance PR Kid New Users to Excel 2 March 13th 08 09:13 PM
MACRO TO GET BALANCE FIGURE K[_2_] Excel Programming 0 December 27th 07 04:40 PM
rent received/balance owed/running balance spreadsheet Quickbooks dummy Excel Discussion (Misc queries) 1 January 2nd 06 07:34 PM
Get Balance of an entry helmekki[_96_] Excel Programming 2 October 23rd 05 06:11 PM


All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"