Measure two max value in Excel graph - excel

In the context, I have a star spectral graph and there are two spectral line. The coordonate of graph are : x = Angstrom and y = relative intensity.
For example, on 6562 Angstrom there is a relative intensity of 2.12 and on 6520 Angstrom 2.19.
I would like measure the highest spots on the graph for more measurement.
I use Excel.
for example this picture (two spectral line example)
(source: shelyak.com)
how could I find these two points in automatic ways?

Add a third column to your data with the following formula:
'Assuming your data for "Relative intensity" is in column B
=IF(B1>=LARGE($B$1:$B$100,2),B1,NA())
Then, add an extra series to your line plot with this column (which should have only the 2 highest values and #N/A for the rest). Hide the line, add markers and data labels for this new line on your plot. You should get something like this, which updates automatically to highlight only the 2 highest values.
EDIT: Added a screenshot of my graph with 1500 points. Here I changed the formula to reach the end of my data table (this will of course not be exactly the same range on your sheet. look at where your data starts and where it ends):
=IF(B2>=LARGE($B$2:$B$1502,2),B2,NA())

Related

How to color data series point inside plot graph depending on data value in Excel table

On a data/line plot inside Excel, I'd like to color my data points depending on a value inside the table on the same row as the data value, however from a different column.
It's best explained with a picture:
It's essentially a line chart type with the lines removed, and the data points set to bullet type and given an increased radius for visibility. The x-axis denotes the calendar date as dd.mm, and the y-axis contains the values.
Now the Excel table also contains a row called "Time of Day", which can be mo(rning), mi(dday), ev(ening).
Can something like this be done with a line chart, or do I need to use a different type of chart, or is this generally not possible in Excel (which I doubt)?
Excel in use is: Microsoft Excel for Mac, Version 16.51 (21071101).
Here's a way to achieve this:
What I've done is:
Added three columns for the times of day (columns B, C and D). These can be hidden.
Added this formula in B2: =IF($E2=B$1,$F2,NA()) which should then be dragged to cover the next two columns and then down to cover every day.
Selected A1:D11 (it'll be more than 11 on your version)
Went to Insert > Chart > Insert Line or Area Chart > Line With Markers
At this point you have a line chart with three series (mo, mi, ev). The lines can be removed, which just leaves the markers. You can format each series separately, with different colours, shapes, sizes, etc.
As a special bonus, this automatically gives you a legend that explains the colours.

I only want to see actual x values to show on horizontal axis of Excel Chart (with scale matching those values) not let Excel do scaling and labeling

Below is an Excel Chart for the data shown in column A (x-coordinates--dates) and column B (y-coordinates--test results). There's no problem with the column B data. But note that the horizontal axis shows quite a few more dates than are contained in column A.
Is there any way to have only the actual x-coordinates shown on the horizontal axis with a scale that matches those values?
I kind of get it. Excel deliberately scales the horizontal axis to match as best it can the data in column A. But I don't want that. Beneath each "corner" point of the graph, I'd like to see the date that is associated with the test result in column B.
In other words, there is clearly a point with y-coordinate 154.5. I'd like to see 2/13/2018 directly below that point since that is the data in row 5. Note that the x-axis contains the "correct" date for the first plotted point: (2/9/2017, 70). But for the point with y-coordinate 80, it looks as if that test result occurred on 6/9/2017 rather than 6/16/2018.
So I'd like the graph to appear as shown in the second image, which likely would be impossible because of the "crowding" of x-coordinate values at the right-hand end, but just displaying whichever of the three dates would fit would be good enough, as would just showing one of the two dates in other "crowded" areas. That is to say that something like the third image would be fine.
I suppose I could write VBA code to make it happen, but I'd prefer that Excel do it.
(What crosses my mind is, "Are exact dates really this important?" And the jury is still out on this point. There are arguments both ways. I guess a hung jury goes to the judge, Excel.)
By inserting the points to be plotted into two arrays, datesArr and scaledArr, and putting those values into columns A and B (see worksheet) and in code saying ...
Set ch = ActiveChart
Set s = ch.SeriesCollection
s(1).Values = scaledArray
s(1).XValues = datesArr
... I got exactly what I wanted. Now granted that's not exactly built-in, but we're programmers, yes? And this was downright easy. Well, once I learned a few tricks, especially being able to set angle of dates to 45 degrees.
You need to plot two sets of data, the actual values, and a set of zeros, then smoke and mirrors make it work.
Data below left, make a line chart (top left chart). Add data labels to the second series; I colored the labels orange to match the points, for clarity in this description. Default labels show Y values, which are all zero (top right). Format the data labels to show category values (i.e., dates), below the points, rotated upwards (bottom left). Format format format (bottom right). Axis labels: none. Format second series with medium gray lines and medium gray cross markers. Drag bottom of plot area upwards to make room for the date labels. Hide legend.

Excel Line chart using start and end values as data

So I need to make a line chart, the columns will be split to 9 objectives, and the rows a 1-6 scale. USers are asked to rank themselves between 1 and 6 at the start and end of the course and I wish to show a line for each objective to signify the travel from point A. (start) to point B (end)Somehting like this:
I just can;t seem to make it work! Any suggestions?
In my opinion there are at least three possible approaches to this but each one has it drawbacks:-
(1) Just plot each Line separately as a Line graph and move it to a separate sheet (right-click and select Move Graph). Then you can put the graphs next to each other. The down-side is that it is rather fiddly and you may not want them to appear as separate graphs.
(2) Do the first graph as a Scatter using 1 and 2 as the x-coordinates and your first 2 points as the y-coordinates. Then do the next graph with x-coordinates 2 and 3 and use copy and paste to move it onto the same axes as the first graph (click on the line joining the points and use Ctrl-C and Ctlr-V to copy it onto the first graph). The downside is that each line copied in this way will come out in a different colour and once again it is fiddly to change it.
(3) Do the whole thing as one Scatter graph. You need to re-format the data as below to get some suitable coordinates. To get the break between the lines you need a genuine empty cell (not "" produced by a formula) so I suggest you copy the coordinates in pairs (e.g. F2:G3 to F5:G6) and leave every third pair of cells in the column empty. Then select the whole range F2:G27 and insert a Scatter with straight lines joining the points. Fix the X-axis range from 1 to 9.9 and the y-axis range from 1 to 6 and add axis labels and title as required. The downside of using a Scatter like this is that you only have numbers rather than text along the X-axis but it shouldn't matter in your case where you just need an objective number at each tick mark.
In F2:-
=INT((ROWS(F$1:F1)+2)/3)
In F3:-
=F2+0.9
In G2:-
=IFERROR(INDEX($B$2:$C$10,INT((ROWS(G$1:G1)+1)/3),MOD(ROWS(G$1:G1),3)),"")

Highlighting data range whille retaining original data label axis

So I'm not sure whether this can be done or not, but I want to highlight certain scatter plot points on my graph whilst still retaining the original axis labels. This is a little snip of my data:-
(0.5,0.525] 272
(0.925,0.95] 116
(0.975,1] 446
(1,1.025] 2840
(1.975,2] 974
(2,2.025] 1400
I have a scatter plot of the first column as my x-axis and the second column as my y-axis. Currently I'm highlighting the points that I want (such as (1,1.025] 2840by adding it as a new legend entries series, but to get it to align horizontally with the original data I've had to number all the points from 1 onwards and add the horizontal axis labels that way, so that all the points that are highlighted mask the other points behind it that contain the horizontal data labels. Is there a way of overcoming this without formatting the data for the x-axis numerically? Or a way of incorporating the data labels separately?
Just to illustrate the problem, I've attached an image at the end of this post. The columns mzRange and Frequency on the left handside were used to plot the graphs, whilst the columns on the right handside of the graph were used to highlight the points on the bottom graph. However, as the x-axis is labelled with the bin ranges from the column on the left, it goes up in a numerical fashion as seen with the numbers on the left most column, meaning I have to use the position number of the bins to then place the highlighted points (as seen with the column on the right handside of the graph that goes 18,34,36 etc) which in turn hides the information of the m/z bin range. Hope this makes sense.
The data in the mzRange is not numeric. If it is used as the data source for the X axis, it will result in the data points being numbered ascending on the X axis.
The only way to plot over a data point is to use the exact X and Y values as the original data point. You could mark the highlights in a column next to the original mzRange column and then plot the whole column.
See this screenshot:
Note how the X axis has nothing in common with the values of column B, although that was used as the data source for the X axis. The red dot highlights are placed in the rows that determine the position on the X axis. This way, the label that appears when hovering over the data point remains intact.

Highlight points on an Excel Line Graph according to a list

I have 2 data series, which records how much a user is meditating/attentive (out of 100) plotted onto a graph. The x axis is the number of seconds since the start of the experiment, and the y axis shows the value for meditation/attention at that point of time.
I have a 3rd set of data that is a series of key timestamps during the experiment (not exactly matching the timestamps from attention/meditation values).
I want to create a graph where you can compare how the attention/meditation values change at the key points
Whether the key points are highlighted by a line or dots I don't care. I tried adding the 3rd data set as a secondary axis, but it still uses the original x-axis of the main graph and I don't know how to make excel do what I want.
Thanks in advance
You should use an XY Scatter chart, not a line chart. A line chart ignores any numerical value in the X values, treats each X value as a text label, and uses the X values from the first series as X values for all series.
You can format the first two series so that they use lines and not markers, and the third so it uses markers without lines.
You may find this link helpful: superuser.com/questions/825692 You don't need to use the secondary axis, just add another series with tag times and constant 45 value, then format vertical error bars to 100% and horizontal to 0%.

Resources