#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Custom functions

I have a formula that I use to balance my check book. If column D of the
current row (row of the current selected cell) is not 'P', It takes the value
in column G of the previous row, subtracts the value in column E of the
current row, adds the value in cell F in the current row and populates it
into column G of the current row. If column D of the current row (row of the
current selected cell) IS 'P', then column G of the current row is equal to
column G of the previous row.

Currently, I copy and paste the formula from cell (G,n-1) to cell (G,n). How
can I make this into a function?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Custom functions

Why not just make it an IF() statement that you can 'fill' down the sheet in
column G as needed?

Assuming some column titles in row 1, and row 2 has starting information
(starting balance in G2), then in G3 enter this formua:
=IF(D3="P",G2,G2-E3+F3)

Then fill that formula down the sheet as far as you need it to go, and
continue filling further as your list of entries in the other columns grows
longer.

See Excel Help on 'Fill Data' or 'Fill data in worksheet cells' and the
sub-topic(s) 'use the fill handle to fill data' and 'Fill formulas into
adjacent cells' for specifics on how to extend (fill) the formula on down the
sheet without having to do individual copy/paste operations.

"GKW in GA" wrote:

I have a formula that I use to balance my check book. If column D of the
current row (row of the current selected cell) is not 'P', It takes the value
in column G of the previous row, subtracts the value in column E of the
current row, adds the value in cell F in the current row and populates it
into column G of the current row. If column D of the current row (row of the
current selected cell) IS 'P', then column G of the current row is equal to
column G of the previous row.

Currently, I copy and paste the formula from cell (G,n-1) to cell (G,n). How
can I make this into a function?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Custom functions


"fill' down the sheet in column G as needed?" is what I am currently doing.
I guess I just wanted to learn how to create a function out of it.

"JLatham" wrote:

Why not just make it an IF() statement that you can 'fill' down the sheet in
column G as needed?

Assuming some column titles in row 1, and row 2 has starting information
(starting balance in G2), then in G3 enter this formua:
=IF(D3="P",G2,G2-E3+F3)

Then fill that formula down the sheet as far as you need it to go, and
continue filling further as your list of entries in the other columns grows
longer.

See Excel Help on 'Fill Data' or 'Fill data in worksheet cells' and the
sub-topic(s) 'use the fill handle to fill data' and 'Fill formulas into
adjacent cells' for specifics on how to extend (fill) the formula on down the
sheet without having to do individual copy/paste operations.

"GKW in GA" wrote:

I have a formula that I use to balance my check book. If column D of the
current row (row of the current selected cell) is not 'P', It takes the value
in column G of the previous row, subtracts the value in column E of the
current row, adds the value in cell F in the current row and populates it
into column G of the current row. If column D of the current row (row of the
current selected cell) IS 'P', then column G of the current row is equal to
column G of the previous row.

Currently, I copy and paste the formula from cell (G,n-1) to cell (G,n). How
can I make this into a function?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Custom functions

Although it can be done, I wouldn't advise to do this via a function.
You can trick the system, but that is not wise and you can't be sure of compatibility for future versions.
That means you'll have to include all precedent cells in the argument list of the function; it would be called like this:

=MyFunction(D3,G2,E3,F3)

Hardly any advantage over your formula

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



"GKW in GA" wrote in message ...
|
| "fill' down the sheet in column G as needed?" is what I am currently doing.
| I guess I just wanted to learn how to create a function out of it.
|
| "JLatham" wrote:
|
| Why not just make it an IF() statement that you can 'fill' down the sheet in
| column G as needed?
|
| Assuming some column titles in row 1, and row 2 has starting information
| (starting balance in G2), then in G3 enter this formua:
| =IF(D3="P",G2,G2-E3+F3)
|
| Then fill that formula down the sheet as far as you need it to go, and
| continue filling further as your list of entries in the other columns grows
| longer.
|
| See Excel Help on 'Fill Data' or 'Fill data in worksheet cells' and the
| sub-topic(s) 'use the fill handle to fill data' and 'Fill formulas into
| adjacent cells' for specifics on how to extend (fill) the formula on down the
| sheet without having to do individual copy/paste operations.
|
| "GKW in GA" wrote:
|
| I have a formula that I use to balance my check book. If column D of the
| current row (row of the current selected cell) is not 'P', It takes the value
| in column G of the previous row, subtracts the value in column E of the
| current row, adds the value in cell F in the current row and populates it
| into column G of the current row. If column D of the current row (row of the
| current selected cell) IS 'P', then column G of the current row is equal to
| column G of the previous row.
|
| Currently, I copy and paste the formula from cell (G,n-1) to cell (G,n). How
| can I make this into a function?


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
TWO CUSTOM FUNCTIONS NOT BEING CONNECTED FARAZ QURESHI Excel Discussion (Misc queries) 0 January 26th 08 08:21 PM
Custom Functions DTTODGG Excel Worksheet Functions 7 January 11th 08 07:37 PM
Custom Functions Sloth Excel Discussion (Misc queries) 5 July 25th 06 04:59 PM
Using custom functions within custom validation Neil Excel Discussion (Misc queries) 4 December 14th 05 10:40 PM
Custom Functions scott Excel Worksheet Functions 2 December 28th 04 12:23 AM


All times are GMT +1. The time now is 03:39 PM.

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"