Envelope plot in excel - excel

I am trying to plot the envelope (maximum) values of a series of data. What I need is not the maximum value of the y-axis as the value of x-axis increase but an envelope or spectrum which joins only the maximum points as the values of x-axis increase.
My data look like:
If I ask for the maximum y-values as the values of the x-axis increase, I will get this one (the black line is the maximum of all data as x is asceding):
But I need a line which joins only the next maximum points till x=30 and then the maximum values, which descend (from x=30 to x=100). The curve I need should be smooth and not follow the values of the data but only join the next maximum.
The next curve is the envelope but only after the absolute maximum point. At the left of the absolute maximum point the envelope is not the wished one:

After posting my questions (as comments), I think the following will do what you want (here I'm assuming I understood what you need):
1) At any point along the X axis, you already know how to recognize a maximum,
2) If (1) is correct, you will take into account a maximum (i.e. make it part of the envelope curve) if and only if:
a) All the points to the right are lower than the current maximum, and/or
b) All the points to the left are lower than the current maximum.
Intuitively, this should work.
EDIT:
Assuming that data is arranged in columns, say between B and D and rows 10 to 100, define in cell E10 the following:
=IF(AND(MAX(B10,D10)>MAX(B9:D9),AND(MAX(B10,D10)>MAX(B11:D11)),MAX(B10,D10),"")
This formula will result into a value if you have a local maximum in rows 11 to 99 or blanks otherwise. Then, drag the formula till row 100 and voilĂ !!!
Note that the first and last point (i.e. rows 10 and 100) might yield a wrong result though. To prevent that, just alter the formula in those two rows.
Hope this is what you were looking for.

Related

Is there an EXCEL function to choose the closest points below a certain line?

Suppose that we have a scattered series of data X,Y randomly spaced (in the pic they are ordered, but this doesn't matter) and a line which shows the maximum limit we are considering for a sub-application.
Is there a combination of functions to choose the closest points below the orange line? I've tried with a MAXIFS + LOOKUP, but didn't solve anything.
The formula of your line is: y=1.17*x, so you create a helper column, containing a formula like:
=IF(1.17*A3-B3>0;1.17*A3-B3;100000)
This means: calculate the difference between the line and the point if that difference is positive. In case it's negative (which means that the point is above the line), then show a value which is that large that it won't be taken into account while calculating the minimum.
You drag this formula all over the column.
You calculate the minimum of that column (one of the easy ways to do this, is using the autofilter).

Calculating a route between two cells, distinguishing between "land" and "water" cells

World Map
I am using Excel and VBA for D&D and have made a world map seperating resources between different cells. I am using this to calculate the distance between the towns and the resources, so that I can calculate the price per pound of the resource.
In order to find the distance between two points (the resource and the town) I use this formula:
=SQRT(([#ROW]-$C$2)^2+([#COLUMN]-$D$2)^2)
This finds the hypotenuse between the two points, using the columns and rows difference as the other sides of the triangle.
However, I need to go one step further and have a means to tell whether the hypotenuse travels through water tiles or land.
You need a function that gives you a list of cells along your hypotenuse. Then you test each cell to see if it is land or water.
Step 1: Determine the biggest distance vertically or horizontally
Step 2: Divide the smallest distance by the largest distance. This ratio is the distance you move in the smallest direction for each unit of the largest.
Step 3: do a for for loop x to y step 1 for the largest distance. for each iteration of the loop cumulatively add the ratio from 2 to the start position of the smallest. The get the cell reference from the current largest plus the (integer +1) part of the start plus cumulative movement distance in the direction of the shortest.

Omitting zeros and shortening x axis automatically in an excel graph

I have a data set of time periods (in this case 16, but I would also need this to work for much larger ranges), which will have a set of values starting at a random period and ending at a random period. The data will either be a value or a zero, and it will not be intermittent.
So for example it could run 0,0,0,0,10,12,12,11,14,16,0,0,0,0,0,0 or 0,0,10,12,12,11,14,16,0,0,0,0,0,0,0,0. Or any other combination, including there being a value in every period.
The data is in a table with the time period in one column and the value in the next column.
Is it possible to have excel set up to automatically plot the data in a line graph, but to not plot the zero values *and automatically shorten the x axis to fit**emphasized text*.
So in the examples above the x axis would start at the first time period with a value (10) and finish at 16.
You could try using a pivot chart and omitting the zeros in the chart data.

how to calculate mode value of paired numbers?

My Excel spreadsheet contains 500 coordinate points from a 2D space. I want to find the mode value of these 500 coordinate points. The estimation of mode value of any set of numbers is pretty simple. It's simply the highly repeated number among the set of numbers. In excel:
=MODE (A1:A10)
yields mode of data from A1 to A10.
However, a coordinate point is a pair of x and y coordinate. Calculating mode value of x and y coordinate individually may cause an error because individual x coordinate might be paired with many y coordinates and vice-versa. Is there any formula in excel to obtain mode value of paired numbers such as 2D coordinate points?
One way is to use a helper column to convert the coordinate pairs to a single number and then use MODE on the helper column. The helper column formula would be something like =A5*100000+B5 where the 100000 is a large enough number to elevate the significant digits of the first coordinate beyond the significant digits of the second coordinate.

Excel average every 0.5 meters, irregular distances between data points

I have a data set that has height values every so often, like topography data in a straight line with GPS coordinates. I used the GPS coordinates and trigonometry to make a cumulative distance column. However, the distance between points varies. Sometimes its 10 cm sometimes its 13, sometimes its 40.
I would like to take the average height every 0.5 meters, but sometimes the distance column doesnt even land on a multiple of 0.5! This would mean my output column would be significantly shorter than my raw data column.
I think my main problem is I do not know what this process is called in order to Google it. Another problem is that the distances are irregular as mentioned above. Things I think may have something to do with it:
averageif?
binning? I do not want a histrogram though, just the data.
Thanks for the help and if you do not know the answer but at least know what I should be writing in the search bars that would be helpful as well. Thanks!
Perhaps this will work for you. I made up a series of distance vs height measurements and determined that a third order polynomial curve fit pretty well. (A different curve might best fit your real data, so you would have to alter the formula accordingly). I then used that formula to derive a set of new heights for the desired ditances at, in my example five unit differences.
The formula under Extrapolated heights is an ARRAY formula entered into all the cells at once. You select D2:D12, enter the formula in D2 and, hold down CTRL-SHIFT while hitting ENTER. If you did this correctly, you will have the same formula in each cell surrounded by curly braces {...}
Then you can decide how you want to "Average" the heights.

Resources