#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cash Flow

I have read a lot, but still can't figure out the best way to do this:

I have 60 cells aligned horizontally: (Jan-05 to Dec-09)
Above the dates I have a project cash flow.

First I need to report the date at the first occurence of cash flow (a
negative number).

Secondly, I need to report the date at the last occurence of cash flow
(a positive number).

This is so I could set up for the XIRR function. The problem is that
the cash flow appears in various dates and durations based on the
project parameters, so I can't lock the XIRR calc to specific cells.

Any help or guidance is greatly appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Cash Flow

Scan the row from left to right and look for the first value less than zero,
then continue to scan for the last value greater than zero

So assuming the values are stored in row A column 1 to 60, after you run it
xneg will contain the column number with the first negative value (or zero
if there is not one) and xpos will contain the last postive value (or zero
if there is none or if there is no negative value found).

Dim xc as integer, xneg as integer, xpos as integer
xneg = 0 : xpos = 0
for xc = 1 to 60
if cells(1,xc) < 0 And xneg = 0 then xneg = xc
if cells(1,xc) 0 And xneg 0 then xpos = xc
next

Hope this provides a template to work with.

--
Cheers
Nigel



wrote in message
oups.com...
I have read a lot, but still can't figure out the best way to do this:

I have 60 cells aligned horizontally: (Jan-05 to Dec-09)
Above the dates I have a project cash flow.

First I need to report the date at the first occurence of cash flow (a
negative number).

Secondly, I need to report the date at the last occurence of cash flow
(a positive number).

This is so I could set up for the XIRR function. The problem is that
the cash flow appears in various dates and durations based on the
project parameters, so I can't lock the XIRR calc to specific cells.

Any help or guidance is greatly appreciated!



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
FV with inconsistant cash flow [email protected] Excel Worksheet Functions 2 February 14th 07 05:33 PM
Cash Flow Lindy-Jane Charts and Charting in Excel 1 November 28th 06 02:19 PM
Cash flow charts Struggling of Essex Excel Discussion (Misc queries) 2 September 28th 05 09:30 PM
Cash Flow Omalley Excel Discussion (Misc queries) 2 July 28th 05 01:16 PM
Cash Flow Set-Up Gary T Excel Worksheet Functions 0 January 13th 05 05:07 PM


All times are GMT +1. The time now is 05:18 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"