Close Window
Free Ebook
Get Your Free Excel
Top 15 Excel Tutorials from
Instant Access!

Excel Rolling Regression


i have a problem with a regression.

I have a standard regression with about 10 years of data.


r = a + Beta*X + e

and i wish to calculate the beta, this is pretty simple, but what i want to do is at any given periode, only calculate the Beta based on the previous 100 days. Is this possible to do in excel? And is it possible to get the results graphically?

If not in excel, is it easily enough to do in another program?

thanks for your help

Free Excel Courses

Similar Excel Tutorials

Helpful Excel Macros

- This UDF (user defined function) calculates the Future Value of Compound Interest in Excel. The mathematical formula th

- This is very similar to the other Vlookup type Macro in that it returns all of the results that match a particular se

- This Excel macro filters data in Excel to display results that contain 1 of 2 possible values. This macro uses the xlor

- This free excel macro allows you to open any program on your computer from excel. You can open a media player, file vie

- Sort data that doesn't have headers in ascending order in Excel with this macro. This is a simple sort macro that assum

Similar Topics

I have a file that became too big due to phantom bloat, unused range saved by Excel and all that kind of reasons. Thank to previous posts on that board tackling that issue, I was able to find how to proceed to reduce the file back to its normal size.
But I did so in a beta file (test file). The real file has become so big (103MB!) that Excel cannot even open it anymore! The file contains archive info that we do not have anywhere else.
Is there anyway then to open the file or to reduce its size without opening it (through magics...)? I just honestly don't know how to retrieve that info before deleting that file.

Thank you very much for your help.

A previous poster explained what I also need; there were no responses,
so I thought I would try again.

Does anyone know of an Excel template--or a small stand-alone
program--that will calculate the interest/principal breakdown when
payments are varied in amount and frequency? Free or low-cost, please.
I need one that will work on my Mac/Office 2004. I will need to print
out periodic reports.

Here is the way the previous poster described it:
"Excel template: Loan Amortization for random/irregular payments,
figures days
between payment dates.
I have a loan with a variable beginning balance and irregular payments
annual large payment. (based on collections)
Would like to enter payment and date.
then Excel would figure days since last payment, interest amount,
amount, Ending Principal balance.
And total interest paid, total pricipal paid
If I change the starting principal, excel would recalculate all

Thanks very much.


I have two columns of data: column A contains the date and time in the form dd/mm/yyyy. Column B contains a number value. All the times are in order, so column A looks like:


I have data from 2007 to 2010. I need to calculate an average daily value (in column B) for each month, and display it in column C. So, for January, I need to calculate the average of 31 days, February, 28 days, etc.

Is there a function I can use to do this? I've been trying the AVERAGEIF formula but can't get it to work. Any ideas would be much appreciated!

Many thanks,

So I've got some data, which has the approximate form of a sine function. I want to find all the x-axis intercepts. I tried using the intercept function and swapping around the y values for the x values, but it only returns 1 value (so I'd guess it uses a linear regression to estimate a single line through the axis).

I was thinking of trying a nested if/and statement but I haven't quite figured out how to do it. Basically I want to identify the two values where it switches from positive to negative and also indentify the values where it goes negative to positive, I can then fit a straight line between them to find a better approximation of the intercept (though it might not be necessary). Preferably I'd like it all one function as I'm not doing it in VBA (I might do later though, we'll see).

Can anyone suggest how I'd find these value or the x-intercept. Any help would be greatly appreciated.

I have an excel worksheet that adds two other worksheets in a data
triangle. I copied it to create a new data set and used find &
replace to change the worksheet references to the new ones.

The cells still contain the result of the old formula referring to the
previous worksheets. The only way I can get the formula to return the
correct result is to edit (F2) each cell and press enter. Calc now
(F9) does nothing.

I've seen this before, but this time, I need to calculate many
thousands of cells and don't have time for this workaround.

Any ideas?


Don S

This formula is supposed to calculate difference between today and date hired to give years and months of service. Works fine for all except if the person was hired in year 2000 then this formula shows 110 y. Any one know how to fix this? or have a different formula that works.

=DATEDIF(E21,TODAY(),"y")&" y "&DATEDIF(E21,TODAY(),"ym")&" m"


Good afternoon!

I'm working with Excel 2003 sp 3 on Windows xp.

I have been banging my head trying to jar loose the formula to calculate man days where 1 equals 8 hours. I have one that was given to me by a coworker:


That calculates man days from total hours. I need a formula that will total man days and return the man day answer. Example:

weekending 12/25 = 16.2 which is 16 man days and 2 hours
weekending 1/1 = 24.7 which is 24 man days and 7 hours

Total = 41 man days and 1 hour

I have also been asked if there was a way for a number to be entered into a spreadsheet and automatically put in order without a macro or "pushing a button".

Any advice is greatly appreciated!

Happy New Year!

~ Brenda ~

Very new in this board. If I post this question in the wrong forum please bear with me.
There is about 20 staffs in our department and I have made a spreadsheet with 12 tabs for each month of the year Jan-Dec. If each staff have 15 days annual leave each year and how can I make a formular that can automatically calculate the balance of annual leave and entered in the tabs of the following months. For example if staff A used 5 days in Jan how can the balance of 10days be entered in the tabs from Feb-Dec. If he use another 5 days in July the remain balance of 5 days be automatically entered in the tab from Aug to Dec. Likewise if staff A took 2 days sick leave in Jan, and 2 days in Mar how can this sick days be automatically sum up in the months after. I am doing this manually at the moment and it is very time consuming and also very easy to make mistake.
Thanks and sorry for this long questions

Hi there

I am trying to calculate our On Time Delivery. I want this as a simple percentage of jobs. I have got this running in the following way:

Column M - Estimated Delivery dates
Column N - Actual Delivery dates
Column O - =IF(SUM(M2-N2)>0,1,0)

Then I have calculated On Time Delivery as: =SUM((SUM(O2:O252))/(COUNTA(N2:N252)))

This seems to work fine. My problem is, if we enter a date in Estimated without a corresponding Actual date, the formula for Column O fills out anyway and improves our On Time Delivery Percentage. How can I set this up so that the formula doesn't calculate if there is no data in Column N?

Any help much appreciated



I use Excel 2000
I have sheet muster for my clients of January, 2005 like :
( P = Present, A=Absent )
Days Sun Mon Tue Wed
Date 1 2 3 4

1 John P A A P
2 Lucy A P P A
Now I want to calculate the total Sundays, Mondays, Tuesdays etc. present in
that month. How can I do this?
Knowldege is Power

I need information on how to enter the proper syntax (formula) so that excel
can calculate overtime hours. In california over 8 hrs in one day is
overtime. The 8 would be considered regular hours and anything over is OT.

I'm trying to come up with a solution to calculate the man hours and days worked over multiple sheets.

I have a file that has 8 sheets. the first seven sheets are the days of the week and the 8th sheet is where I want to calculate the hours.

The days of the week consists of "Name" "Date" Hours"

The 8th sheet consists of "Name", "Days of the week in their own column (7 columns in total)", "Total Hours" and "Total Days Worked"

Now... each day is always a different group and what I'm hoping for is to create a formula that can grab each name with their hours and throw them into the 8th sheet. So when the end of the week is done I have all the Employees weekly hours and days worked all finished.

I hope this makes sense. This file is to track about 100 employees that are on a rotational work schedule.

I have attached a sample file.

Thanks in advance for your help.

I have a spreadsheet set up with an employees information, including the start date. After each year that the employee is working, he gets bumped up on the pay scale. For this reason, I only need to know how many years the employee has been working, rounded down to the nearest year.

This is what I have so far (hire date is in column B):

=((TODAY()-B4)/365)&" YEARS"

This function gives me a number with many decimal places.

I tried:

=ROUNDDOWN((TODAY()-B4)/365),0)&" YEARS"

It tells me I have too few arguments. Please help!

I need a formula to calculate Turn Around Time. Find below the sample data and details for your reference.

Received Date & Time: 10/29/2010 3:27:00 PM
Completed Date & Time: 11/1/2010 3:57:32 AM
Business Hours: 08:00 AM to 05:00 PM
Non Business hours: 05:00 PM to 08:00 AM
Weekdays : Monday to Friday
Weekends: Saturday & Sunday

If I calculate TAT for this time period it should show me 1 hour 33 minutes, why because business hours are closing by 5:00 PM on 10/29 so it should not calculate duration after 5:00 PM to until 08:00 AM on next day, however 10/29 is Friday so formula should calculate the duration from 10/29 Friday 3:37 PM to 10/29 5:00 PM and again it should calculate from 8:00 AM on 11/01 Monday and formula should skip Saturday & Sunday.

In this scenario I have completed the task before 8:00 AM on 11/01 so it should show duration of 1hour 33 minutes.

Please let me know if you need any more details

On my calculator, if I divide 462,534.05 by 335 I get 1,380.70. Then if I times 1,380.70 by 335 I get 462,534.50. Which is what I need it to be because I need to calculate the difference of a figure not dividing equally.

On excel, if I divide 462,534.05 by 335 I get 1,380.70. Then if I times 1,380.70 by 335 I get the SAME result of 462,534.05.

I have to account for the difference of not dividing equally so there is some format or accounting function that's preset that I don't want but I have no idea how to fix it or format my excel sheet to calculate as my calculator would.

Please can someone help? Thanks!

Is it possible to have numbers added to the same cell and have excel continue
to calculate the addition for me in that same cell......ex: I have the number
8 in cell d2 and I want to add the number 8 to that cell and have excel add
the 8 to the previous 8 for a total of 16 in the same cell.....the next time
I would add 5, and the total would be 21? Can this be done in a single cell?

In Excel I have been trying to find an easier way to calculate a time
difference where the times cross midnight. Example:
Start time: 23:50:00
End time: 00:15:00

How would you formulate an equation to determine the duration of time or
differnce between the start and end time?

Is there a way to calculate the average days between a column of dates?

Basically, I've got a sheet that contains a table of entries, and each entry gets a date stamp in the first column. I would like to have the sheet display the average time, in days, between entries. Is this possible?

Thank you in advance!

I have a spreadsheet where I need to calculate the increase in % one year over the other in column D for Eg if Profits are 95415 in Jan 2008 (Column B) and 80215 in Jan 2008 (Column C), then the % Increase will be (95415-80215)/80215 *100

I can calculate the formula for this, but the problem comes where for eg there is a loss in Jan 2008 for -95415 and there was a profit in Jan 2007 for 80215. How do I set up formula to take negatives & positives into account in calculating the increase or decrease/

Your assistance or anybody's on the forum will be greatly appreciated




How can I calculate a 3% anual rent increase over 15 years (3% over the last year's rent)?

I have attached a schedule for shift allowance calculation. The conditions for payment are as follows:

3 & 4 shifts = 15% Basic
2 shifts = 10% Basic
If on leave for 21 working days or more, no shift allowance
If on leave for less than 21 working days and on 3 or 4 shifts, shift allowance prorated as (Basic*15%)/21*(diff. btw 21 and no of days leave observed)

If on leave for less than 21 working days and on 2 shifts, shift allowance prorated as (Basic*10%)/21*(diff. btw 21 and no of days leave observed)

The formular I used in the attached worked but the only problem is that I had to sort by no. of shifts and adjust the formular first. I need A formular that does not require sorting. I tried to combine IF, AND, OR formulae but I got error. Please assist me sort this out. Thanks a bunch.

I have a problem sometimes. I will click on a cell to add information.
The cell turns blue and then wherever I move, it highlights those to.
No matter where I go on the page. If I Alt-Tab and work in another
program on my computer, that excel page keeps highlighting wherever
I move even in those other programs (I know this sounds confusing).
When I return to excel thousands and thousands of cells are blue.

The biggest problem is that the highlighting won't turn off, no matter
what. I can't select anything from the tool bars, do any work on the sheet or close the program.
I can close it only with the task manager but when I open it again,
the cursor is still stuck in the highlighting mode and won't perform any
other functions.

Do you think this is a problem with my computer, the excel program? I have changed my mouse and this didn't help.
Is there some shortcut to turn off this highlight feature other than restarting
my computer. Which is the only current way I can get rid of it.

Thanks for any advice,

I have a spreadsheet with simple (addition/subtraction) formulas. The file is quite large and the formulas are too. All of a sudden, the formulas stopped working except when I double click in the cell containing the actual formula. For example, if I enter "2" in each cell, A2 and B2, cell B3 should reflect "4" because there is a formula in cell B3 which totals cells A2 and B2. Only by double clicking on cell B3 will the program actually calculate. I'm totally perplexed and so is my IT contact. Anyone?

I did a bit of browsing on this problem. Found others suffering the same but haven't found any conclusive answer yet.

Every so often when I attempt to save a file, (including save as), Excel won'r let me. By won't let me I mean:

using Save doesn't appear to do anything using Save As doesn't either do anything, the dialog is not displayed and if I am doing via the File menu then the File menu is exited and the previous ribbon tab is displayed (i.ethe one I was on before clicking 'File') if I close the workbook I am prompted to save, close without saving or cancel. Clicking save just invokes the same msgbox again. I can't work out when it goes into this mode. Some days I can work without this problem, other days I encounter this 2 or 3 times.

The only thing I could suspect was I think this started around about the time I installed xlDennis' code library. I have uninstalled the addin and so far so good, but I cannot categorically say that this was the cause.

Anyone have any idea?


Edit: I have read this: / /> Doesn't seem to cover the issue I describe

Need a formula to calculate weeks stock in hand based on 12 months forecast.

Here is the example.

Jan2011 Feb2011 Mar2011 Apr2011 May2011 Jun2011 Jul2011 Aug2011 Sep2011 Oct2011 Nov2011 Dec2011 ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- Product XXXXX Actual/Forecast : 174 1674 574 574 524 524 524 524 524 728 728 728 New Purchases : 0 0 0 0 1002 0 0 0 0 0 0 0 Goods In Transit: 0 1506 0 0 0 0 0 0 0 0 0 0 Other Movements : 0 0 0 0 0 0 0 0 0 0 0 0 Closing Stock : 1270 1102 528 -46 432 -92 -616 -1140 -1664 -2392 -3120 -3848 Week Stock in Hand ? ? ? ? ? ? ? ? ? ? ? ?

So, in Month of Jan2011 the Closing stock is 1270, need a formula to calculate how many weeks will this stock cover look at future forecast.

Related pages

how to write scientific notation in excelshortcut for filter in excel 2007stock valuation in excelinstr vba excellinking excel to powerpointexcel chart broken axislookup exact matchfreefile vbavba filenamehow to calculate percent change in excelblood pressure chartingtime zone converter pst to istexcel scatter plot data labelscsv pipe delimitedhow to put percentage formula in excelformula indirect excelwhat does a dollar sign mean in an excel formulaexcel for loopsmail merge email with attachmentshow to calculate percentages on excelexcel highlight duplicate rowsexcel link to file in same folderaverage line in excel graphruntime error 91 in vb6rundown formatpercentages in pivot tablesconditional statements in excelexcel conditional formatting between sheetsinsert checkmarkfractional odds to decimal converterwhat is xla fileconvert 5 mbps to kbpsdigit convert to words in excelcurrency converter excelannualized turnover formulalbs stone converteropen xlsx file in excel 2003format timespanmillion to lakhs convertercounting down days calculatorternary graphaccess workday functionhow to split windows in excelvba wildcardexcel convert number to words chequeconverter weight stone to poundscombine multiple columns in exceldiff excel filestime difference calculator in millisecondsexcel vba ado recordsetif cell contains text then countvba splash screenexcel vba select workbookhow to lock a cell in a formulavlookup commandnetwork days formulanavy pfa calculator onlineaging calculation in excelhow to put tick in excelsumif andexcel macro buttonsconvert excel to kmlcannot open xlsm filealternate shading excelxls is not a valid win32 applicationexcel forecast templatereversefindbubble graphs in excelexcel delete double entriesvlookup multiple tablessscc 18 formattimecard in excel with formulas