Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
platform8
 
Posts: n/a
Default If, formula's and datastreams


Hi there,
I have a csv file of a 1000 random numbers.
I'd like to import that into excel and have excel analyse each number
(as it arrives, hopefully) to determine wether it's value is higher or
lower than the previous value.
I'd then like, say, 3 consecutive similar results (i.e.
higher,higher,higher) to put an higher or lower text string in a
separate cell along with the last number analyzed. e.g

123
653
100
200
234 "higher 234"
566
433
288
64 "lower 64"
356
654
222
111
544
677
888 "higher 888"

If possible I'd also like to have a configureable percentage value so I
could use an If value increases by 20% then trigger the text string
output and If value decreases by 15% then trigger the text string
output.

Any help appreciated
Thanks
Platform8


--
platform8
------------------------------------------------------------------------
platform8's Profile: http://www.excelforum.com/member.php...o&userid=35497
View this thread: http://www.excelforum.com/showthread...hreadid=552667

  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default If, formula's and datastreams

try something like this
Sub consecutivehigherlower()
Columns(2).ClearContents
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row

If Cells(i + 1, 1) Cells(i, 1) _
And Cells(i + 2, 1) Cells(i + 1, 1) _
And Cells(i + 3, 1) Cells(i + 2, 1) Then
Cells(i + 3, 2).Value = "Higher " & Cells(i + 3, 1).Value
End If

If Cells(i + 1, 1) < Cells(i, 1) _
And Cells(i + 2, 1) < Cells(i + 1, 1) _
And Cells(i + 3, 1) < Cells(i + 2, 1) Then
Cells(i + 3, 2) = "Lower " & Cells(i + 3, 1)
End If
Next i
End Sub

--
Don Guillett
SalesAid Software

"platform8" wrote in
message ...

Hi there,
I have a csv file of a 1000 random numbers.
I'd like to import that into excel and have excel analyse each number
(as it arrives, hopefully) to determine wether it's value is higher or
lower than the previous value.
I'd then like, say, 3 consecutive similar results (i.e.
higher,higher,higher) to put an higher or lower text string in a
separate cell along with the last number analyzed. e.g

123
653
100
200
234 "higher 234"
566
433
288
64 "lower 64"
356
654
222
111
544
677
888 "higher 888"

If possible I'd also like to have a configureable percentage value so I
could use an If value increases by 20% then trigger the text string
output and If value decreases by 15% then trigger the text string
output.

Any help appreciated
Thanks
Platform8


--
platform8
------------------------------------------------------------------------
platform8's Profile:
http://www.excelforum.com/member.php...o&userid=35497
View this thread: http://www.excelforum.com/showthread...hreadid=552667



  #3   Report Post  
Posted to microsoft.public.excel.misc
platform8
 
Posts: n/a
Default If, formula's and datastreams


Thanks ever so much, just the start I need.

Platform 8


--
platform8
------------------------------------------------------------------------
platform8's Profile: http://www.excelforum.com/member.php...o&userid=35497
View this thread: http://www.excelforum.com/showthread...hreadid=552667

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



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