Video Lessons Note:If you select a chart that has more than one data series without selecting a data series, Excel displays the Add Trendline dialog box. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want. CHARTTOOLS. This is the most straightforward way to shorten your excel sheet. Let's add a trendline to a line graph. There are two ways to access the Trendlines and finally add them:-. Click the save as. 35+ handy options to make your text cells perfect. If you click the Chart Elements button to add a trendline without selecting a data series first, Excel asks you to which data series you want to add the trendline. Is there a way to get Excel to output the values of the trendline parameters (a and b) to cells in the workbook? Understand how Machine Learning is used to perform clustering in Excel. problem solved - used log (x) as new column and then do straight polynomial fitting on that! SO I will not be able to use this equation to get R2 for the polinominal or any other trendlines except of the linear and compare the R2 for different trendlines. z o.o. This is where you set the formatting of the selected trendline. Thank you , this is clear, please share with us how to get the second part. Home Courses Artificial Intelligence & Machine Learning AI and ML with Excel Training Albany, NY. I have a chart which plots several different data series in a simple linear graph. This is a reasonable fit, as a value over 0.75 is generally considered a decent onethe closer to 1, the better. Select "Format Trendline" from the menu options. My input X values are 2000, 3000, 4000, , but Excel use number 1,2,3, as the input value. Typically, a linear trendline describes a continuous rise or fall over time. Select Text to Columns. In lines above these (not included), the series are added, trendlines inserted, and DisplayEquation is called for each trendline. Nice in terms of design, it significantly reduces the formula's accuracy when you manually supply x values in the equation. However, please keep in mind that it's only for demonstration purposes. Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range. Add a trendline to your chart to show visual data trends. Select the Trendline option. you are saying polinominal 2 is more accurate than polinominal 3, but without comparing R2 you can not tell this. From the window that appears, you can manage every aspect of the Trendline. What function i have to use to enter to be solved. Keep in mind that spaces count as characters. Basically how to force the Y intercept through the origin. Select the chart, click the Chart Elements button, and then click the Trendline checkbox. You cannot create an exponential trendline if your data contains zero or negative values. the sum of the y's should sum to a total) but there are voids throughout. The Format Trendline pane opens so you can select the trendline you want. Remove a trendline. I checked the data thoroughly, based on your suggestion. Notice that the R-squared value is 0.9036, which is a good fit of the line to the data. You can also give your trendline a name and choose forecasting options. Select OK. Select the type of stock chart you wish to use. 3. The correct y values range from -20 to 80. You can also choose other formatting categories to display within the task pane by simply clicking the desired category icon to edit. The link to our top 15 tutorials has been sent to you, check your email to download it! In this case, I do not know a way to get R2 other than by building a chart. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to change, or do the following to select it from a list of chart elements. A moving average trendline uses a specific number of data points (set by the Period option), averages them, and uses the average value as a point in the trendline. However, you can change the number of digits for a selected trendline label in the Decimal places box on the Number tab of the Format Trendline Label dialog box. merci. In this article, well cover how to add different trendlines, format them, and extend them for future data. Thanks for a terrific product that is worth every single cent! For line data without a chart, you can use AutoFill or one of the statistical functions, such as GROWTH() or TREND(), to create data for best-fit linear or exponential lines. To do this, select the column of data you want to truncate and click the "Home" tab in the toolbar at the top of the program. Select the cell where you want the truncated text to appear. Click Close. The following video lesson, titled Formatting Trendlines, shows you how to format trendlines in Excel charts. To manage a Trendline, you just have to get to the Trendline Options window. Thank you Svetlana. 50+ Hours of Video Click at the Chart Element icon and test the Trendline checkbox. Excel Courses Online A power trendline in Excel is drawn based on this simple equation: Where a and b are constants, which can be calculated with these formulas: a: =EXP(INDEX(LINEST(LN(y), LN(x),,), 1, 2)). Basically, this is mostly used as a visual aid to illustrate an upward, downward, or flat trend over varying data points in a chart. Note:You cannot display trendline equations for a moving average. It's possible to present an equation and R-squared value for trends in a chart using Microsoft Excel: The trendline equation calculates the optimum line to suit the datasets. Is there an easy way around this? Below are the steps to add a trendline to a chart in Excel 2013, 2016 and above versions: Select the chart in which you want to add the trendline. = 0)? Thanks for the information they were extremely helpful although I have some issues: Use the switch to show or hide the trendline. How to keep it working in Horizontal data table? Have you tried taking the log (base 10) of the equation, then using the polynomial trendline formulas, described above? I suspect that you're asking for the theory behind a linear trend line, so let's start there. Calculate mass by subtracting final mass from initial mass. errors (mine included) are the result of missing values, but I don't have time to investigate further. The option to add the R 2 value is in 2. it works fine to me! If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. If you select Moving Average, type the number of periods that you want to use to calculate the moving average in the Period box. A power trendline is a curved line that is best used with data sets that compare measurements that increase at a specific rate for example, the acceleration of a race car at one-second intervals. I checked the Format->Trendline window on all the other lines and they show the "Backwards" box grayed out. Looking for Office 2010 steps? That's it! but only if the known_x and known_y vectors are columns if they are rows instead, it gives me #VALUE error is this normal/is there any way to use the function working with row input series? 07:18 AM Then click the Format Selection button that appears below the drop-down menu in the same area. Choose the account you want to sign in with. The equation is a 6th-degree polynomial. In Excel 2019, Excel 2016 and Excel 2013, adding a trend line is a quick 3-step process: Click anywhere in the chart to select it. (If you don't see the email, check your Spam or Promotions folder and make sure to add us as a contact so you get our emails in the future. AbleBits suite has really helped me when I was in a crunch! Therefore I want to update via VBA. You do not have to build these formulas manually, simply tell Excel to display the trendline equation in a chart. You can also create a moving average, which smoothes out fluctuations in data and shows the pattern or trend more clearly. In the Add Trendline dialog box, select any data series options you want, and click OK. On the Format tab, in the Current Selection group, select the trendline option in the dropdown list. Excel trendline equation is wrong - reasons and fixes, How to add a moving average trendline to an Excel chart, display the trendline equation in a chart, Why Excel trendline equation may be wrong, How to add an average or benchmark line in Excel graph, Compare 2 columns in Excel for matches and differences, CONCATENATE in Excel: combine text strings, cells and columns, Create calendar in Excel (drop-down and printable), How to calculate percent variance for negative numbers, How to show more decimal places in a trendline equation, https://support.office.com/en-us/article/linest-function-84d7d0d9-6e50-4101-977a-fa7abf772b6d, Sort and filter links by different criteria, Find, extract, replace, and remove strings by means of regexes, Customizable and adaptive mail merge templates, Personalized merge fields depending on the recipient or context, "Send immediately" and "send later" scheduling. work fine and calculate a,b for y=ax+b, =TREND({2;6;10},{1;2;3},4) Is that possible and if so what would be the Excel formula code? 200+ Excel Guides, Excel Macro & VBA Course (Beginner to Expert), How to Create and Manage a Chart in Excel, Complete Guide to Printing in Excel Macros - PrintOut Method in Excel, Filter Data in Excel to Show Rows/Data That Meet Multiple Criteria for One Field - AutoFilter, Update, Change, and Manage the Data Used in a Chart in Excel, Quickly Add, Edit, & Manage Business Specific Diagrams in Excel (SmartArt). For creating a trendline in excel, follow the below steps: Select the whole data, including Column headings. PC Review is a computing review website with helpful tech support forums staffed by PC experts. Choose a trendline option or click More Trendline Options. Optionally, it returns the value from that trend for the new_xs value. College professors take note. However, I am not sure on polynomials. I have a column of sales we've made thus far and have it plotted on a chart, where I also use plynomial trendline. 2. A very cool feature of trendlines in Excel is the option to extend them into the future. When none of the trendline options (exponential, linear, logarithm, polynomial, power) fit well, can a different formula be used? Inserting Chart. Step 1: Insert the data in the cells of Excel. I want to do it for all existing trendlines in all sheets and . If you have a completely different form then I . I also increased the width to 2 pts and changed the dash type. To manage a Trendline, you just have to get to the Trendline Options window. Thanks. 1. Exercise File: Subscribe to access. Well I figured out that re. A linear trendline is a best-fit straight line that is used with simple linear data sets. Is it possible to use an IF condition to control the display of a trendline on a scatterplot?, for example something along the lines of: Then click the Format Selection button that appears below the drop-down menu in the same area. A good practical example is using the moving average trendline to reveal fluctuations in a stock price that otherwise would be difficult to observe. A moving average trendline smoothes out fluctuations in data to show a pattern or trend more clearly. From the Format Trendline pane, click the Trendline Options category, and then type a value in the Forward box under Forecast.. You can help keep this site running by allowing ads on MrExcel.com. " =IF(A1==1,Show exponential trendline, IF(A1==2,show logarithmic trenline, show linear trendline)) ". When adding a polynomial trendline in an Excel chart, you specify the degree by typing the corresponding number in the Order box on the Format Trendline pane, which is 2 by default: For example, the quadratic polynomial trend is evident on the following graph that shows the relationship between the profit and the number of years the product has been on the market: rise in the beginning, peak in the middle and fall near the end. We need to create another column that it can sort numerically. We use cookies to make wikiHow great. In line charts, column and bar graphs, numeric values are plotted only on the y-axis. data can be formatted such that it does not shown on the chart by setting. In the chart, select the data series that you want to add a trendline to, and then click the Chart Design tab. What if we want to find the coefficients to the trendline equation with the y-intercept set equal to a particular value (e.g., y-int. When adding a trendline in Excel, you have 6 different options to choose from. An easy fix is to show more decimal places in the equation. My trendline plots correctly but the trendline equation solution for y yields incorrect y values. though it is based only on the plotted points. Svetlana, The x values range from 1900 to 2050. I tried to lug the equation back to re-test the equation, but the result isn't the same. Everything else matches the other (short) trend lines. How to correct the problem. As an example, let's draw a power trendline to visualize the chemical reaction rate. There at the bottom of that box, you will find an option named "Format trendline". This will add the trendline to your chart (the steps will be the same for a line chart as . How can I change all instances of a word to a letter in Excel? 4. In the list box, click the data series that you want, and then click OK. On the Layout tab, in the Analysis group, click Trendline. It may not display this or other websites correctly. thanks a lot, you resolved my problem in a few minutes kudos, Thank you so much for this post! I know how to insert a trendline covering all the data, and extrapolating. @Ian_HeathIf you have a formula that you think works why not just calculate the corresponding points on the sheet and then add it to the graph? A value of 0.81 is shown. The formulas for higher degree polynomial trendlines can be built by using the same pattern. Select the chart, click the "Chart Elements" button, and then click the "Trendline" checkbox. Lets add a trendline to a line graph. To format trendlines in Excel, click the "Format" tab within the "Chart Tools" contextual tab in the Ribbon. Sergey. Trendline reliability A trendline is most reliable when its R-squared value is at or near 1. does not work! Then select a trendline to format from the "Chart Elements" drop-down in the "Current Selection" button group. Choose the trendline you want to use from the list, and it will be added to your chart. Thanks for your quick reply, the RSQ formula returns the square of the Pearson product moment correlation, but Pearson equation is only for linear correlations. Where b1 b6 and a are constants. Refer to the below screenshot. Thanks to all authors for creating a page that has been read 476,717 times. 200+ Video Lessons Change the file name if necessary. Click the "Number" icon to access formatting options for numbers in your spreadsheet. An exponential trendline by using the following equation to calculate the least squares fit through points: where c and b are constants, and e is the base of the natural logarithm. Conclusion. In the list box, click the data series that you want, and then click OK. On the Layout tab, in the Analysis group, click Trendline. Theyre typically used to show a trend over time. It is useful, for example, for analyzing gains and losses over a large data set. I don't know how to thank you enough for your Excel add-ins. Add a Trendline. Turning; . Alternatively, you can calculate the coefficients by using a formula corresponding to your trendline type, and format the formula cells so that they show a sufficient number of decimal places. Shorten the distance between production data and insight (Ep. Cancel Download. This is very helpful information. Then click the "Format Selection" button that appears below the drop-down menu in the same area. =TREND({2;6;14},{1;2;3}^{1,2},4) How can I make x=y in scatter plots in excel? For this, simply click the Increase Decimal button on the Home tab in the Number group. the last 3 months). Hi Jeremy, You can add a trendline to a chart in Excel to show the general pattern of data over time. The linear trendline equation uses the least squares methods to seek the slope and intercept coefficients such that: For linear regression, Microsoft Excel provides special functions to get the slope and intercept coefficients. I am using the latest Mac OS and Microsoft office. I have problem with trendline equation. I have calculated the a,b,c coefficients for my binomial equation (y = ax2+bx+c). And they said the X value and Y value cells i have to rename to be cell of 4 name box (x) and 6 name box (y) . Manage a Trendline. Here's the chart with a trendline for each series. I have two data series. Note the R-squared value of 0.9918, which means that our trendline fits the data almost perfectly. Click on drop down arrow to the right of:-. If you are looking for how to insert a trendline in an Excel chart, please check out the above linked tutorial. Then select the Format Trendline command from the pop-up menu that appears. Linear Trendline : Linear trendlines are mostly used when the data sets are linear in nature. If you have any other questions, please dont hesitate to ask. You can only add trend lines to a chart, so if you don't have one create one . Here is how I did chart2: 1) Starting with Chart 1, use Select Data (right click chart and locate this command) 2) Edit Seres1 changing the x-range from A3:A21 to A3:A8 and the y-range to B3:B18. Click the Trendline button and then click More Trendline Options. When you make a trendline in these charts, Excel uses those assumed x-values in the trendline formula. Excel uses a least squares method to give you the best linear fit to your data. Anybody who experiences it, is bound to love it! I am trying to extract all the coefficients of this formula: y=10^(ax^4+bx^3+cx^2+dx+e). Find out more about the Microsoft MVP Award Program. 2. I have a graph showing daily stock prices for several years. In this example, a Moving Average trendline has been added to the charts Tea data series. Select "Connect data points with line". 50+ Hours of Instruction You can find all the formulas in the second part of this tutorial (Excel trendline equations and formulas). Were committed to providing the world with free how-to resources, and even $1 helps us in our mission. If you want. Each of these series has a linear trend line. Click where it is. Note:These steps apply to Office 2013 and newer versions. Thanks a lot Svetlana, Spencer & Kinia. Sorry for my hasty response, I overlooked that you were looking to compare R2 of all different trendlines. You can add a trendline to an Excel chart in just a few clicks. We select and review products independently. In the Trendline Options category, you can set the type of trendline to show for the selected series in the chart. Open the worksheet that contains the chart. Format the selection as you will see in the following image. Ideal for newsletters, proposals, and greetings addressed to your personal contacts. 3. 541) sponsored post. How to Group and Outline Excel Data: Easily Collapse Rows of Info, 3 Easy Ways to Convert Microsoft Excel Data to Word, https://www.techonthenet.com/excel/formulas/left.php, (Truncate Text in Excel). The formulas assume that you have 2 sets of variables: independent variable x and dependent variable y. Feb 02 2021 Add one-of-a-kind styles of the trendline (exponential, logarithmic, and polynomial) to the chart and test "Display R-squared value on the chart" and "Display Equation on Chart" boxes. The trendline will span the entire range of data, even. We have a great community of people providing Excel help here, but the hosting costs are enormous. Where the Format tab is, choose the trendline option in the Current selection group from the dropdown list. Truncating Text Using the LEFT and RIGHT Formulas, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/2\/22\/Truncate-Text-in-Excel-Step-1-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-1-Version-6.jpg","bigUrl":"\/images\/thumb\/2\/22\/Truncate-Text-in-Excel-Step-1-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-1-Version-6.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":544,"licensing":"
License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot)
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/d\/db\/Truncate-Text-in-Excel-Step-2-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-2-Version-5.jpg","bigUrl":"\/images\/thumb\/d\/db\/Truncate-Text-in-Excel-Step-2-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-2-Version-5.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/3\/34\/Truncate-Text-in-Excel-Step-3-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-3-Version-6.jpg","bigUrl":"\/images\/thumb\/3\/34\/Truncate-Text-in-Excel-Step-3-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-3-Version-6.jpg","smallWidth":460,"smallHeight":348,"bigWidth":728,"bigHeight":550,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/9\/95\/Truncate-Text-in-Excel-Step-4-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-4-Version-6.jpg","bigUrl":"\/images\/thumb\/9\/95\/Truncate-Text-in-Excel-Step-4-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-4-Version-6.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":541,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/5\/50\/Truncate-Text-in-Excel-Step-5-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-5-Version-6.jpg","bigUrl":"\/images\/thumb\/5\/50\/Truncate-Text-in-Excel-Step-5-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-5-Version-6.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/8\/8b\/Truncate-Text-in-Excel-Step-6-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-6-Version-6.jpg","bigUrl":"\/images\/thumb\/8\/8b\/Truncate-Text-in-Excel-Step-6-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-6-Version-6.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/c\/ce\/Truncate-Text-in-Excel-Step-7-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-7-Version-6.jpg","bigUrl":"\/images\/thumb\/c\/ce\/Truncate-Text-in-Excel-Step-7-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-7-Version-6.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":541,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/d\/d5\/Truncate-Text-in-Excel-Step-8-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-8-Version-6.jpg","bigUrl":"\/images\/thumb\/d\/d5\/Truncate-Text-in-Excel-Step-8-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-8-Version-6.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/8\/86\/Truncate-Text-in-Excel-Step-9-Version-6.jpg\/v4-460px-Truncate-Text-in-Excel-Step-9-Version-6.jpg","bigUrl":"\/images\/thumb\/8\/86\/Truncate-Text-in-Excel-Step-9-Version-6.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-9-Version-6.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":545,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/c\/c2\/Truncate-Text-in-Excel-Step-10-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-10-Version-5.jpg","bigUrl":"\/images\/thumb\/c\/c2\/Truncate-Text-in-Excel-Step-10-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-10-Version-5.jpg","smallWidth":460,"smallHeight":348,"bigWidth":728,"bigHeight":550,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/3\/3f\/Truncate-Text-in-Excel-Step-11-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-11-Version-5.jpg","bigUrl":"\/images\/thumb\/3\/3f\/Truncate-Text-in-Excel-Step-11-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-11-Version-5.jpg","smallWidth":460,"smallHeight":341,"bigWidth":728,"bigHeight":540,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/a\/aa\/Truncate-Text-in-Excel-Step-12-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-12-Version-5.jpg","bigUrl":"\/images\/thumb\/a\/aa\/Truncate-Text-in-Excel-Step-12-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-12-Version-5.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/d\/d3\/Truncate-Text-in-Excel-Step-13-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-13-Version-5.jpg","bigUrl":"\/images\/thumb\/d\/d3\/Truncate-Text-in-Excel-Step-13-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-13-Version-5.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/1\/13\/Truncate-Text-in-Excel-Step-14-Version-5.jpg\/v4-460px-Truncate-Text-in-Excel-Step-14-Version-5.jpg","bigUrl":"\/images\/thumb\/1\/13\/Truncate-Text-in-Excel-Step-14-Version-5.jpg\/aid712981-v4-728px-Truncate-Text-in-Excel-Step-14-Version-5.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"
\n<\/p><\/div>"}. how to shorten trendline in excel