Hi
I'm wondering if there is an easy way of finding multiple max or min values (peaks) on a graph (data set)
Please see the attached image. I would like to know the value of each of the 10 peaks (marked with red dots) to average the value. I've got loads of graphs like this that needs the same averaging of peak values, and was just wondering if there is such a function in excel instead of looking through each data set and manually finding each of the 10 peak values.
Last edited by heffalompen; 09-02-2009 at 09:51 AM.
I'ts not that simple because peaks aren't uniformy defined.
Can you upload example worksheet?
If you have sensitive data copy->paste as values values into new workbook and upload.
"Relax. What is mind? No matter. What is matter? Never mind!"
Basically if your source values were listed say in Column A row 2 onwards then in B you could use something like:
You can then simply obtain your result using:Code:B2: =IF(AND(A2>A1,A2>A3),A2,"") copied down
Code:=AVERAGE(B:B)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
But there are some peaks that are excluded
"Relax. What is mind? No matter. What is matter? Never mind!"
Good point zbor... in which case yes as you state we will need more info - specifically in regard to the thresholds that govern local max (ie % fluctuation etc...) ... sorry I missed that point.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I would rather go over Y=6 (must see how to get that value),
and look for max in intervals where Y=6 intercept with function.
But would be easier if I get inputs![]()
"Relax. What is mind? No matter. What is matter? Never mind!"
Or with min's wich are more emphased than max's
"Relax. What is mind? No matter. What is matter? Never mind!"
Edit: removed formula as it addressed "peak" values in the data but not for the chart peaks.
Last edited by Palmetto; 09-02-2009 at 10:18 AM.
Thanks for the fast reply guys. I've attached a excel sheet with a similar data set if that makes things easier.
Perhaps this link may be the start of a solution. Scroll down and see the links at the bottom of the thread.
Calculate Maximum Point On Curve From Xy Scatter Graph
Maybe a bit simplistic, but a possible approach.
Maybe simplistic, but nevertheless a big help. At least it makes it much easier to scroll through the data set to find the peak values. Thank you very much.
Still open for more suggestions if you guys and girls got any.
EDIT: Just so you people don't misunderstand me (referring to Palmettos edited post). I don't need to find and mark the peak values on the chart/graph it self, as long as I can extract/get the peak values from the data set I'm fine. The chart/graph was just to give you an idea of what kind of peaks I was talking about.
Last edited by heffalompen; 09-02-2009 at 12:10 PM.
I'm stuck.
I think you need to take =ATAN() from your numbers to get graph like this:
max_min(2).xls
From this diagram it's easier to take minimums (where you must define what's minimum).
untitled.JPG
It's something you need to define manualy (let say in cell A1)
Therefore you find is max/min>A1 -> that's peak.
Like it said in example: is that one peak or 2? (you said that's 2 but someowhere need to be defined).
But what I don't know how to do is when you find first minimum, set 0 (look sheet 2, I set it manually) and go to find second minimum and set again 0.
Those 0's are crucial. After you define them you can find max and average within those intervals wich again I don't know how to set.
But I hope this will give someone idea how to do that.
"Relax. What is mind? No matter. What is matter? Never mind!"
I kinda figured it wouldn't be easyReally appreciate the effort.
If I manually have to define my intervals that kinda defeats the purpose, that's basically what I want to avoid.
I've attached a picture that shows the peaks I'm talking about. There are 10 max peaks (red) and 9 min peaks (green) that I'm interested in, the 10 max and 9 min values within those squares (regardless if there are 2 or 3 peaks within one of those squares, I just want the one and only max and min value)
But when thinking of it it seems very complicated. I guess one had to create a check to see if the previous number was higher (for the max peaks) or lower (for the min peaks) than the previous number, but that again would give me almost twice the amount of peak values in return that I was looking for since there are basically two peaks within the peak (square box) I'm looking for (poor explanation, made sense in my head)
Last edited by heffalompen; 09-02-2009 at 06:11 PM.
I think WHER's suggestion was very good. A minor variation would give minima instead of maxima, or both.
The aperture size could be put in a single cell and changed, while observing the plot, to get it right for the data (assuming the data has some periodicity, as shown in the example).
For example, define
conAper refers to: =$C$1
rgnAper Refers to: =INDEX(Sheet1!$A:$A, ROW() - conAper / 2):INDEX(Sheet1!$A:$A, ROW() + conAper / 2)
... and WHER's formula to
=IF(OR(A51=MAX(rgnAper), A51=MIN(rgnAper)), A51, NA())
Then adjust C1.
Last edited by shg; 09-02-2009 at 07:18 PM.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks