Slope line is very useful for spotting which values have changed from two sets. You can add a slope line to XY chart (scatter plot) using simple techniques. In this post, learn how to add them.

Steps for adding slope line to Excel XY charts
Imagine you are analyzing app downloads for two weeks. Your data looks like this. You want to quickly visualize which apps have been downloaded more this week.

- Select Last week & this week columns and create XY chart (scatter plot). You will get this.

- In a blank range, create slope series like this. The starting values will be 0,0. Ending values can be manually typed or you can use MAX() formula to generate them from data.

- (continued). Now add this slope series to the scatter plot. We will end up with this chart.

- Change the slope series to “Scatter with straight line” type of chart. To do this, right click on the orange dots (slope series) and select “Change series chart type”.

- Format everything. Add a chart title, space out the grid lines and format the slope line. Your chart will be almost ready.

- Bonus step: You can add a text box to the chart and type in “more this week” in it and place it above the line. This will help in reading the data better. Here is our final XY chart with slope line.

Slope line in XY charts – When to use them & tips
Slope line is a great way to enhance the readability of certain types of scatter plots. Consider adding them whenever you are visualizing data from two time periods or two similar situations. Examples are,
- Last year vs. This year sales
- Male vs. Female customers by stores
- Failure rate in machinery before and after maintenance
- Test scores of students in two different subjects
Tips for working with slope line:
- Always annotate the axis (use either axis titles or put text boxes near them)
- Consider highlighting few of the points on charts based on the value. For example, we can highlight apps that have significantly change in downloads. Like this:

Here is a tip on how to highlight important points on a chart.
Download sample workbook
Click here to download sample workbook with slope line example. It also shows all the steps needed to create these charts.
Adding slope line to scatter plots – video
I created a video explaining slope line technique. You can also see my quarantine look (full beard + nearly crazy hair). See it below or head to my YouTube channel.
Other tips to make your charts pop
If you are looking for a place to polish your charting game, you’ve come to right place. Check out below examples to learn something unique, useful and uplifting. Click on image to view the relevant tip.





















6 Responses to “Make VBA String Comparisons Case In-sensitive [Quick Tip]”
Another way to test if Target.Value equal a string constant without regard to letter casing is to use the StrCmp function...
If StrComp("yes", Target.Value, vbTextCompare) = 0 Then
' Do something
End If
That's a cool way to compare. i just converted my values to strings and used the above code to compare. worked nicely
Thanks!
In case that option just needs to be used for a single comparison, you could use
If InStr(1, "yes", Target.Value, vbTextCompare) Then
'do something
End If
as well.
Nice tip, thanks! I never even thought to think there might be an easier way.
Regarding Chronology of VB in general, the Option Compare pragma appears at the very beginning of VB, way before classes and objects arrive (with VB6 - around 2000).
Today StrComp() and InStr() function offers a more local way to compare, fully object, thus more consistent with object programming (even if VB is still interpreted).
My only question here is : "what if you want to binary compare locally with re-entering functions or concurrency (with events) ?". This will lead to a real nightmare and probably a big nasty mess to debug.
By the way, congrats for you Millions/month visits 🙂
This is nice article.
I used these examples to help my understanding. Even Instr is similar to Find but it can be case sensitive and also case insensitive.
Hope the examples below help.
Public Sub CaseSensitive2()
If InStr(1, "Look in this string", "look", vbBinaryCompare) = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub
Public Sub CaseSensitive()
If InStr("Look in this string", "look") = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub
Public Sub NotCaseSensitive()
'doing alot of case insensitive searching and whatnot, you can put Option Compare Text
If InStr(1, "Look in this string", "look", vbTextCompare) = 0 Then
MsgBox "woops, no match"
Else
MsgBox "at least one match"
End If
End Sub