#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Winners & Losers

Hello,

I have a system that tracks my stock speculation on a spreadsheet that
looks like this:

Row Col A Col H
25 10/1/06 +1.58
26 10/2/06 -
27 10/3/06 -
28 10/4/06 +1.63
29 10/5/06 -0.70
30 10/8/06 -0.05
31 10/9/06 -


Is it possible to track CONSECUTIVE WINS/LOSSES in cell H5? H25:H1000
will either have a PLUS or MINUS figure, or blank.

Thanks in advance.
-Erick

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Winners & Losers

Erick,

If you mean the total of latest run of like gains/losses then try a UDF:

Function CountIt()
Application.Volatile
Dim EndRow As Long
Dim x As Long
Dim Tot As Long

EndRow = Cells(Rows.Count, 8).End(xlUp).Row

If EndRow < 25 Then
MsgBox "No Data"
Exit Function
End If

For x = EndRow To 25 Step -1
If (Cells(x, 8).Value 0 And Cells(x - 1, 8).Value 0) Or _
(Cells(x, 8).Value < 0 And Cells(x - 1, 8).Value < 0) Or _
(Cells(x, 8).Value = 0 And Cells(x - 1, 8).Value = 0) Then
Tot = Tot + 1
Else: Exit For
End If
Next x

Tot = Tot + 1

CountIt = Tot

End Function


Application.Sign does not work in VBA - at least in X97


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"gotta know" wrote in message
ups.com...
Hello,

I have a system that tracks my stock speculation on a spreadsheet that
looks like this:

Row Col A Col H
25 10/1/06 +1.58
26 10/2/06 -
27 10/3/06 -
28 10/4/06 +1.63
29 10/5/06 -0.70
30 10/8/06 -0.05
31 10/9/06 -


Is it possible to track CONSECUTIVE WINS/LOSSES in cell H5? H25:H1000
will either have a PLUS or MINUS figure, or blank.

Thanks in advance.
-Erick



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
how do you set up a table of winners vs. losers with total as %? madcap72712 Charts and Charting in Excel 0 December 17th 06 10:52 PM
listing winners formula sirdef Excel Discussion (Misc queries) 4 June 5th 06 05:26 PM
Excel User Conference - Registration winners Damon Longworth Excel Discussion (Misc queries) 0 April 18th 06 10:55 AM
Excel User Conference - Registration winners Damon Longworth Excel Worksheet Functions 0 April 18th 06 10:55 AM


All times are GMT +1. The time now is 05:54 PM.

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

About Us

"It's about Microsoft Excel"