Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Series Trending

Hello,
I want to know, in a series of numbers, the number of points trending in one
direction (up or down). If I reach a certain number, e.g., 7, I want to
kick out of the routine. I can do this by looping through the cells and
adding up as I go, e.g.

upcounter = 0
for icount = 1 to lastrow
if cells(icount+1,1)cells(icount,1) then
upcounter = upcounter+1
else
upcounter = 0
end if
if upcounter = 7 then goto 100
next icount


100 otherstuff

This takes a while with big data sets. Is there a way to use arrays to do
this? Or some other way?

Thanks in advance.

Bill


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Series Trending

Dim v as Variant
upcounter = 0
v = Range("A1").Resize(lastRow,1).Value
for icount = 1 to lastrow
if v(icount+1,1)v(icount,1) then
upcounter = upcounter+1
else
upcounter = 0
end if
if upcounter = 7 then goto 100
next icount


--
Regards,
Tom Ogilvy


"Bill" wrote in message
ink.net...
Hello,
I want to know, in a series of numbers, the number of points trending in

one
direction (up or down). If I reach a certain number, e.g., 7, I want to
kick out of the routine. I can do this by looping through the cells and
adding up as I go, e.g.

upcounter = 0
for icount = 1 to lastrow
if cells(icount+1,1)cells(icount,1) then
upcounter = upcounter+1
else
upcounter = 0
end if
if upcounter = 7 then goto 100
next icount


100 otherstuff

This takes a while with big data sets. Is there a way to use arrays to do
this? Or some other way?

Thanks in advance.

Bill




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
Trending Function? Kevin Excel Worksheet Functions 3 May 4th 10 10:19 PM
Trending Methodology Jeff Excel Discussion (Misc queries) 1 August 17th 09 07:59 PM
polynomial trending Orion Charts and Charting in Excel 6 November 17th 08 05:22 PM
Trending data asim Excel Discussion (Misc queries) 0 July 6th 06 10:13 PM
help on excel reports for anaylsis and trending Terri Excel Worksheet Functions 0 May 4th 05 03:44 PM


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