I have NOT used your sheet. How can you tell, in advance, that there will ALWAYS be 20 rows of data? The sheet I am using is fully automated, and will adapt to ANYTHING up to 1000 rows of raw data and ANYTHING up to 130 rows of filtered data).
If no date is selected, no data will display. (instead of a blank, the formula reurns #N/A - which the chart will ignore. I used Conditional Formatting to colour the #N/A error the same as the shading in the cell, so you don't see them.
I used 2 Named Ranges (CTRL-F3 to view/edit) to select only those values in D and G that are NUMBERS to use in the calculation of the slope and intercept (presented in two different ways - choose whichever you prefer. If you are going to use the numbers in further formulae, then D2 and E2 will be much easier to use, rather than a messy cell containing numbers and text (B2).
Bookmarks