A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data Frequency



 
 
Thread Tools Display Modes
  #1  
Old March 4th, 2009, 10:56 PM posted to microsoft.public.excel.charting
Kyle
external usenet poster
 
Posts: 127
Default Data Frequency

Hello, I have over 100,000 data points. I would like to do a scatter plot of
every 10th or 100th point. What is the best way to accomplish this task?


  #2  
Old March 5th, 2009, 01:27 AM posted to microsoft.public.excel.charting
smartin
external usenet poster
 
Posts: 780
Default Data Frequency

Kyle wrote:
Hello, I have over 100,000 data points. I would like to do a scatter plot of
every 10th or 100th point. What is the best way to accomplish this task?



You could copy the data to a separate range for charting. Use a formula
like

=MOD(ROW(),100)

then filter on the new formula column for any single value to see every
100th row, copy visible cells, paste elsewhere, and chart.
  #3  
Old March 5th, 2009, 12:57 PM posted to microsoft.public.excel.charting
PBezucha
external usenet poster
 
Posts: 72
Default Data Frequency

Kyle,

More meaningfully you should select the appropriate number of reduced
points, regardless of a changing number of original ones. This, in a
comfortable way, can be achieved by the following macro. You are free to add
mandatory prefices to variable names.

Option Explicit

Sub DataReduction()

'Petr Bezucha, 2008

'Subroutine reduces the count of xy data points to a set number
'and places the new range into the set position.
'Prerequisition is that the variables x and y
'should occupy the neighboring columns
Static PtsCount As Long
Dim DataCount As Long, DataStep As Long, S As Range, _
XO As Range, XR As Range, Inp As String, _
CO As Long, CR As Long, RO As Long, RR As Long, RM As Long
Const Title As String = "Data reduction"

'starting proposal
If PtsCount = 0 Then PtsCount = 50
'dispatching inputs
Set S = ActiveCell
On Error GoTo ErrExit
'cell selections are necessary
Set XO = Application.InputBox _
("Select the upmost X-original cell", _
Title, S.Address, , , , , 8)
Set XR = Application.InputBox _
("Select the upmost X-reduced cell", _
Title, S.Offset(, 2).Address, , , , , 8)
On Error GoTo 0

CO = XO.Column
CR = XR.Column
Inp = CStr(PtsCount)
Inp = Application.InputBox("Number of reduced points", _
Title, Inp, , , , , 1)
PtsCount = CLng(Inp)
Application.ScreenUpdating = False
RO = XO.Row
RR = XR.Row
DataCount = XO.End(xlDown).Row - RO + 1
DataStep = DataCount \ PtsCount
RM = XO.End(xlDown).Row - DataStep
Do While RO RM
Cells(RO, CO).Copy Destination:=Cells(RR, CR)
Cells(RO, CO + 1).Copy Destination:=Cells(RR, CR + 1)
RO = RO + DataStep
RR = RR + 1
Loop
Application.ScreenUpdating = True
ErrExit:
End Sub

--
Petr Bezucha


"Kyle" wrote:

Hello, I have over 100,000 data points. I would like to do a scatter plot of
every 10th or 100th point. What is the best way to accomplish this task?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.