Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Maarten
 
Posts: n/a
Default etsimate values of a linear trend for each pair of known values

Hi,
is there a way to automatically fill in the blank cells between two numbers
in a column B using a linear regression between those two points based on
culumn A?
Column A, B1, B5 and B7 are given. Column C (or B) should contain the results.
I could use "b1+(b$5-b$1)/(ROW(b$5)-ROW(b$1))", but then I have to change
the formula after each pair of values B and my data go for 3 years...
A B C
1-jan 10 10
2-jan 12,5
3-jan 15
4-jan 17,5
5-jan 20 20
6-jan 14
7-jan 8 8
8-jan
9-jan

Thanks
Maarten
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default etsimate values of a linear trend for each pair of known values

1) copy the data to another sheet (say A1:B5000)
2) use sort or filter to remove rows with blank values (leaving A1:B1000)
3) name the range with the dates as mydates (say A1:A1000), the range with
number (say B1:B1000) myvalues, the entire range (say A1:B1000) mytable
4) On the main sheet, replace C2 with
=IF(B20,B2,INDEX(myvalues,MATCH(A2,mydates))+(IND EX(myvalues,MATCH(A2,mydates)+1)-INDEX(myvalues,MATCH(A2,mydates)))/(INDEX(mydates,MATCH(A2,mydates)+1)-INDEX(mydates,MATCH(A2,mydates)))*(A2-INDEX(mydates,MATCH(A2,mydates))))

Actally this works except for the last few rows of your data (when there is
no second date to follow)
=INDEX(myvalues,MATCH(A2,mydates))+(INDEX(myvalues ,MATCH(A2,mydates)+1)-INDEX(myvalues,MATCH(A2,mydates)))/(INDEX(mydates,MATCH(A2,mydates)+1)-INDEX(mydates,MATCH(A2,mydates)))*(A2-INDEX(mydates,MATCH(A2,mydates)))
It worked well for me
best wsihes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Maarten" wrote in message
...
Hi,
is there a way to automatically fill in the blank cells between two
numbers
in a column B using a linear regression between those two points based on
culumn A?
Column A, B1, B5 and B7 are given. Column C (or B) should contain the
results.
I could use "b1+(b$5-b$1)/(ROW(b$5)-ROW(b$1))", but then I have to change
the formula after each pair of values B and my data go for 3 years...
A B C
1-jan 10 10
2-jan 12,5
3-jan 15
4-jan 17,5
5-jan 20 20
6-jan 14
7-jan 8 8
8-jan
9-jan

Thanks
Maarten



  #3   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default etsimate values of a linear trend for each pair of known values

forgot: you need to format C2 as General (or number as needed)
copy down the column

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
1) copy the data to another sheet (say A1:B5000)
2) use sort or filter to remove rows with blank values (leaving A1:B1000)
3) name the range with the dates as mydates (say A1:A1000), the range with
number (say B1:B1000) myvalues, the entire range (say A1:B1000) mytable
4) On the main sheet, replace C2 with
=IF(B20,B2,INDEX(myvalues,MATCH(A2,mydates))+(IND EX(myvalues,MATCH(A2,mydates)+1)-INDEX(myvalues,MATCH(A2,mydates)))/(INDEX(mydates,MATCH(A2,mydates)+1)-INDEX(mydates,MATCH(A2,mydates)))*(A2-INDEX(mydates,MATCH(A2,mydates))))

Actally this works except for the last few rows of your data (when there
is no second date to follow)
=INDEX(myvalues,MATCH(A2,mydates))+(INDEX(myvalues ,MATCH(A2,mydates)+1)-INDEX(myvalues,MATCH(A2,mydates)))/(INDEX(mydates,MATCH(A2,mydates)+1)-INDEX(mydates,MATCH(A2,mydates)))*(A2-INDEX(mydates,MATCH(A2,mydates)))
It worked well for me
best wsihes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Maarten" wrote in message
...
Hi,
is there a way to automatically fill in the blank cells between two
numbers
in a column B using a linear regression between those two points based on
culumn A?
Column A, B1, B5 and B7 are given. Column C (or B) should contain the
results.
I could use "b1+(b$5-b$1)/(ROW(b$5)-ROW(b$1))", but then I have to change
the formula after each pair of values B and my data go for 3 years...
A B C
1-jan 10 10
2-jan 12,5
3-jan 15
4-jan 17,5
5-jan 20 20
6-jan 14
7-jan 8 8
8-jan
9-jan

Thanks
Maarten





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trend Line constants as Excel Cell Values Ken Excel Discussion (Misc queries) 7 March 9th 07 03:57 PM
How do I anchor one end of a linear trend line? William Spurlock Charts and Charting in Excel 3 January 15th 06 08:06 PM
in excel, how do I find which values doesn't have a pair? jackies_place Excel Discussion (Misc queries) 2 December 17th 04 05:43 PM


All times are GMT +1. The time now is 06:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"