I have a spreadsheet that i update weekly
What i need is a formula that will just sum the last four weeks
Example column A rows 1-52 will be updated each week in row 53 i just want the last four weeks to be summed.
Dave
I have a spreadsheet that i update weekly
What i need is a formula that will just sum the last four weeks
Example column A rows 1-52 will be updated each week in row 53 i just want the last four weeks to be summed.
Dave
Last edited by Dave69rock; 01-21-2009 at 06:35 AM.
Hi,
To sum the last four populated rows in column A,
=SUM(OFFSET(A1,COUNT(A1:A52)-1,0,-4,1))
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
Thanks sweep
Sweep you might want to add some additional logic to your Row offset parameter to handle the fact that you may have less than 4 weeks of data at a given point in time.
Below is another approach which avoids use of OFFSET (volatile)
=SUM(INDEX(A1:A52,MAX(1,COUNT(A1:A52)-4),1):A52)
The use of MAX will ensure you will always get a valid answer.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
=SUM(INDEX(A1:A52,MAX(1,COUNT(A1:A52)-3),1):A52)
else you'd get last 5 values not 4
correctamundo...
(it was in all honesty a typo)
Hi could any help me on this formula.
=SUMPRODUCT((Date>=$B$5)*(Date<=$B$6)*(Productname=$B$7)*(Causingarea=A18)*Downtime)
Date Product PQVC Causing Area Down Time (Hrs)
10/20/10 WTS q MISC 1.25
10/25/10 QCT v MISC 1.25
10/30/10 QCT v SQ 3.5
10/30/10 WTS c LPT 1.75
i am getting #N/A i dont know why. if remove (Productname=$B$7) or )*(Causingarea=A18) i am getting the correct value, can any one help me
Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks