Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a spreadsheet in cell b13 I start entering data till b59. I want to
take a running average of the last 5 cells that contain data. Not all cells will have an entry and every 6th cell has a different formula. I also want to move this running average to row c. -- mrbob16 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way to model it up for delivery
Target range is B13:B59 In C13: =IF(COUNT(B13)=0,"",ROWS($1:1)) In D13: =INDEX($B$13:$B$59,SMALL($C$13:$C$59,ROWS($1:1))) Copy C13:D13 down to D59. This dynamically screens the target range in col B for numbers, and then packs it up in col D (makes it into a contiguous range) Then place in say, E13: =IF(COUNT($D$13:$D$59)<5,"", AVERAGE(OFFSET($D$13,COUNT($D$13:$D$59)-1,,-5))) E13 will return the desired running average of the last 5 cells that contain data within the target range -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:363 Subscribers:64 xdemechanik --- "mrbob16" wrote: I have a spreadsheet in cell b13 I start entering data till b59. I want to take a running average of the last 5 cells that contain data. Not all cells will have an entry and every 6th cell has a different formula. I also want to move this running average to row c. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am using a lot of columns and those cells are being used. If I get what you
are saying is I have to make a small database that will then average the numbers in order they are placed there? And would it be easier if I sent you what I'm working on so you can see it or just try to put it in here. thanks bob -- mrbob16 "Max" wrote: One way to model it up for delivery Target range is B13:B59 In C13: =IF(COUNT(B13)=0,"",ROWS($1:1)) In D13: =INDEX($B$13:$B$59,SMALL($C$13:$C$59,ROWS($1:1))) Copy C13:D13 down to D59. This dynamically screens the target range in col B for numbers, and then packs it up in col D (makes it into a contiguous range) Then place in say, E13: =IF(COUNT($D$13:$D$59)<5,"", AVERAGE(OFFSET($D$13,COUNT($D$13:$D$59)-1,,-5))) E13 will return the desired running average of the last 5 cells that contain data within the target range -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:363 Subscribers:64 xdemechanik --- "mrbob16" wrote: I have a spreadsheet in cell b13 I start entering data till b59. I want to take a running average of the last 5 cells that contain data. Not all cells will have an entry and every 6th cell has a different formula. I also want to move this running average to row c. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Upload your sample file using a free filehost,
then post a link to it here For example, you could use this free filehost to upload: http://www.freefilehosting.net/ Copy the "direct link" which is generated after you upload, then paste it here in your reply (Desensitize your sample as appropriate) -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:362 Subscribers:64 xdemechanik --- "mrbob16" wrote in message ... I am using a lot of columns and those cells are being used. If I get what you are saying is I have to make a small database that will then average the numbers in order they are placed there? And would it be easier if I sent you what I'm working on so you can see it or just try to put it in here. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
When you say every 6th cell has a different formula, what are you telling us? Should we be ignoring every 6th cell? Why don't you show us some sample data. We are supposed to average the last 5 cells with entries but ?? what about that 6th cell. So are you saying your data might look like this: Bob 5 11/1/2008 4 Red 34 Green Blue 13 23 54 so a running average beside the last cell would average from Green to 54? That's five cells with entries. Or should it average from 4 to 54? But if the number 13 is one of those "other formulas" we should average from 5 to 54? And if the cell above 54 contains a spacebar, then what? Do we average through the date or ignore it or what? Thanks, Shane Devenshire "mrbob16" wrote: I have a spreadsheet in cell b13 I start entering data till b59. I want to take a running average of the last 5 cells that contain data. Not all cells will have an entry and every 6th cell has a different formula. I also want to move this running average to row c. -- mrbob16 |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'll try to do it here
col a col b col c 11-1-08 2.547 11/2/08 2.555 need avg 11/3/08 2.560 need avg of 3 11/4/08 2.575 need avg of 4 11/4/08 need avg of 4or 5 if there is data blank avg of the avgs 11/5/08 2.575 avg of last 5 11/5/08 blank avg of last 5 11/6/08 2.580 avg of last 5 all columns to the right of c contain other data and the avg line is basically an avg of those 5 rows above whether they have data or not but I need to keep a running avg in col c for just the last five cells in colb that have data not blanks. I hopw this helps. I'm not to great with computers so max I'll try and get it uploaded. I hope this will help. thanks bob -- mrbob16 "Shane Devenshire" wrote: Hi, When you say every 6th cell has a different formula, what are you telling us? Should we be ignoring every 6th cell? Why don't you show us some sample data. We are supposed to average the last 5 cells with entries but ?? what about that 6th cell. So are you saying your data might look like this: Bob 5 11/1/2008 4 Red 34 Green Blue 13 23 54 so a running average beside the last cell would average from Green to 54? That's five cells with entries. Or should it average from 4 to 54? But if the number 13 is one of those "other formulas" we should average from 5 to 54? And if the cell above 54 contains a spacebar, then what? Do we average through the date or ignore it or what? Thanks, Shane Devenshire "mrbob16" wrote: I have a spreadsheet in cell b13 I start entering data till b59. I want to take a running average of the last 5 cells that contain data. Not all cells will have an entry and every 6th cell has a different formula. I also want to move this running average to row c. -- mrbob16 |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
My file is way to big for the minimum. But I posted an example and maybe that
would help. -- mrbob16 "Max" wrote: Upload your sample file using a free filehost, then post a link to it here For example, you could use this free filehost to upload: http://www.freefilehosting.net/ Copy the "direct link" which is generated after you upload, then paste it here in your reply (Desensitize your sample as appropriate) -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:362 Subscribers:64 xdemechanik --- "mrbob16" wrote in message ... I am using a lot of columns and those cells are being used. If I get what you are saying is I have to make a small database that will then average the numbers in order they are placed there? And would it be easier if I sent you what I'm working on so you can see it or just try to put it in here. |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Bob,
Tried but afraid I'm out of ideas for you, sorry. What you're after may not be possible to achieve, other than manually. -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:365 Subscribers:65 xdemechanik --- "mrbob16" wrote in message ... I'll try to do it here col a col b col c 11-1-08 2.547 11/2/08 2.555 need avg 11/3/08 2.560 need avg of 3 11/4/08 2.575 need avg of 4 11/4/08 need avg of 4or 5 if there is data blank avg of the avgs 11/5/08 2.575 avg of last 5 11/5/08 blank avg of last 5 11/6/08 2.580 avg of last 5 all columns to the right of c contain other data and the avg line is basically an avg of those 5 rows above whether they have data or not but I need to keep a running avg in col c for just the last five cells in colb that have data not blanks. I hopw this helps. I'm not to great with computers so max I'll try and get it uploaded. I hope this will help. thanks bob -- mrbob16 |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Well I must thank you anyway because I and my coworkers have been working on
this for about 2 months now and we thought it has to be simpler than having to to do it manuallyeach time and without setting up a data base to grab it from. So again I thank you for your time and if you do find a way let me know thanks -- mrbob16 "Max" wrote: Bob, Tried but afraid I'm out of ideas for you, sorry. What you're after may not be possible to achieve, other than manually. -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:365 Subscribers:65 xdemechanik --- "mrbob16" wrote in message ... I'll try to do it here col a col b col c 11-1-08 2.547 11/2/08 2.555 need avg 11/3/08 2.560 need avg of 3 11/4/08 2.575 need avg of 4 11/4/08 need avg of 4or 5 if there is data blank avg of the avgs 11/5/08 2.575 avg of last 5 11/5/08 blank avg of last 5 11/6/08 2.580 avg of last 5 all columns to the right of c contain other data and the avg line is basically an avg of those 5 rows above whether they have data or not but I need to keep a running avg in col c for just the last five cells in colb that have data not blanks. I hopw this helps. I'm not to great with computers so max I'll try and get it uploaded. I hope this will help. thanks bob -- mrbob16 |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
http://freefilehosting.net/download/42g42
hey Max I tried again to upload that problem and realized it said 5mb and i thought it said 5kb so i didn't think it would fit but here it is and i tried to explain what i need on the bottom of the page. thanks again if could look at it one more time. -- mrbob16 "Max" wrote: Upload your sample file using a free filehost, then post a link to it here For example, you could use this free filehost to upload: http://www.freefilehosting.net/ Copy the "direct link" which is generated after you upload, then paste it here in your reply (Desensitize your sample as appropriate) -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:362 Subscribers:64 xdemechanik --- "mrbob16" wrote in message ... I am using a lot of columns and those cells are being used. If I get what you are saying is I have to make a small database that will then average the numbers in order they are placed there? And would it be easier if I sent you what I'm working on so you can see it or just try to put it in here. |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm afraid it's the same conclusion, Bob.
There are 2 issues with your requirements which seem insurmountable to me a. That you want an average result on every line in col C, but it is to somehow disregard any interceding blanks in col B as part and parcel of the "last 5" data rows b. The "interceding" difficulty is further compounded by the presence of a 6th "average" line after each set of 5 lines reserved for data in col B which contains a different formula in col C, and this 6th line is to be, like the blanks in col B, somehow skipped in the desired average of the last 5 cells with data in col B FWIW, here's my best scenario should you decide to review your specs / layout re-design. Supposing the data is continuous in B13 down (w/o any interceding blank cells nor breaks every 6th line), and you want an average of the last 5 cells with data in col B to reflect in col C, then in C13, copied down: =AVERAGE(OFFSET(B13,,,-MIN(COUNT(B$13:B13),5))) will return those results. The top 4 formula cells, ie C13:C16 will return the desired average of last 1 to 4 data cells in col B, while C17, C18, etc down will return the "last 5". -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:365 Subscribers:65 xdemechanik --- "mrbob16" wrote: http://freefilehosting.net/download/42g42 hey Max I tried again to upload that problem and realized it said 5mb and i thought it said 5kb so i didn't think it would fit but here it is and i tried to explain what i need on the bottom of the page. thanks again if could look at it one more time. |
#12
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks again for looking at my problem. Would it be alright if I redesign it
and send you the new format and see if what you wrote would work before I go changing everything. Believe it or not I need this for one little spec out of I can't tell you how many that are more important but I still need it. thanks again bob -- mrbob16 "Max" wrote: I'm afraid it's the same conclusion, Bob. There are 2 issues with your requirements which seem insurmountable to me a. That you want an average result on every line in col C, but it is to somehow disregard any interceding blanks in col B as part and parcel of the "last 5" data rows b. The "interceding" difficulty is further compounded by the presence of a 6th "average" line after each set of 5 lines reserved for data in col B which contains a different formula in col C, and this 6th line is to be, like the blanks in col B, somehow skipped in the desired average of the last 5 cells with data in col B FWIW, here's my best scenario should you decide to review your specs / layout re-design. Supposing the data is continuous in B13 down (w/o any interceding blank cells nor breaks every 6th line), and you want an average of the last 5 cells with data in col B to reflect in col C, then in C13, copied down: =AVERAGE(OFFSET(B13,,,-MIN(COUNT(B$13:B13),5))) will return those results. The top 4 formula cells, ie C13:C16 will return the desired average of last 1 to 4 data cells in col B, while C17, C18, etc down will return the "last 5". -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:365 Subscribers:65 xdemechanik --- "mrbob16" wrote: http://freefilehosting.net/download/42g42 hey Max I tried again to upload that problem and realized it said 5mb and i thought it said 5kb so i didn't think it would fit but here it is and i tried to explain what i need on the bottom of the page. thanks again if could look at it one more time. |
#13
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Suggest you start a new thread for your revised specs/set-up
Avail your post to all responders -- Max Singapore http://savefile.com/projects/236895 Downloads:20,500 Files:365 Subscribers:65 xdemechanik --- "mrbob16" wrote in message ... Thanks again for looking at my problem. Would it be alright if I redesign it and send you the new format and see if what you wrote would work before I go changing everything. Believe it or not I need this for one little spec out of I can't tell you how many that are more important but I still need it. thanks again bob -- mrbob16 .. |
#14
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Dec 3, 4:02*pm, mrbob16 wrote:
Thanks again for looking at my problem. Would it be alright if I redesign it and send you the new format and see if what you wrote would work before I go changing everything. Believe it or not I need this for one little spec out of I can't tell you how many that are more important but I still need it. Well, I couldn't make what Max wrote earlier work, but the concept of a helper column is valid, if you ask me. No matter how many columns you have, you can add another. Unless you are actually at the maximum width. It doesn't have to be column D, it can be far away if necessary. So, if using row 13 as the starting point as in previous examples, and column EA as your helper column.... In column EA: EA13 =1 EA14 =IF(COUNT(B14)=0,EA13,EA13+1) In column C: C13 =AVERAGE(INDIRECT("B"&12+ IF(ISNA(MATCH(EA13-4,$EA$13:EA13,0)), 1,MATCH(EA13-4,$EA$13:EA13,0))):B13) (I broke that formula up for display here, put it back together in Excel with no spaces) |
#15
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You know, I forgot about wanting a different average every 6th cell.
But I don't understand that part. If your 5-cell average may cover more than 5 contiguous rows due to blanks, what does an average of the averages mean every 6th row? It would vary, if you ask me. Should it be an average of the last 5 unique averages, instead? Also, how do you make space for this in a column of different average formulas? See, if you come to row 24, which should be a "6th row average" with a different formula, and if there are amounts in B24 and B25 rather than blanks, then your average of 5 cells where B24 is the 5th cell will NEVER show up. So you've just lost a data point. I guess my point is that the "6th row average" ought to be 2 different things than you have outlined. From what I see, anyway. 1) Perhaps, it should be an average of the last 5 unique averages, not the last 5 rows. 2) But definitely, it ought to be in a separate column so as not to lose data in Column C. |
#16
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If I could spiky can I send you the chart. it is a little easier to show than
to explain. The different formula for the sixth cell is in column c for the averages of the the last five tests whether there is number or not and it is just for that column. What I need is a running average in the other cells to get that average. again let me know if I could send it to you or upload it to you so you can visualize what I mean. Thanks bob -- mrbob16 "Spiky" wrote: You know, I forgot about wanting a different average every 6th cell. But I don't understand that part. If your 5-cell average may cover more than 5 contiguous rows due to blanks, what does an average of the averages mean every 6th row? It would vary, if you ask me. Should it be an average of the last 5 unique averages, instead? Also, how do you make space for this in a column of different average formulas? See, if you come to row 24, which should be a "6th row average" with a different formula, and if there are amounts in B24 and B25 rather than blanks, then your average of 5 cells where B24 is the 5th cell will NEVER show up. So you've just lost a data point. I guess my point is that the "6th row average" ought to be 2 different things than you have outlined. From what I see, anyway. 1) Perhaps, it should be an average of the last 5 unique averages, not the last 5 rows. 2) But definitely, it ought to be in a separate column so as not to lose data in Column C. |
#17
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Dec 9, 5:16*pm, mrbob16 wrote:
If I could spiky can I send you the chart. it is a little easier to show than to explain. That's fine. |
#18
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Actually Spiky the file is still available if you look at the reply I left on
12/2 to max the link is still there to download. -- mrbob16 "Spiky" wrote: On Dec 9, 5:16 pm, mrbob16 wrote: If I could spiky can I send you the chart. it is a little easier to show than to explain. That's fine. |
#19
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I tried my solution in your file and it works, just plug it into the
particular cells like I said above and then copy C13 to each cell where it belongs, and copy EA14 down as far as necessary (at least to EA59). And it will ignore the fact that the 6th row is different as long as you don't put anything in B18, B24, etc. I'm still not exactly sure what you want in the 6th cell, like C18, C24, etc. In different posts you've indicated 2 or 3 different ideas for these cells, and another in the file itself. I think one of these is all you are looking for, and it can be copied to each cell where you want it: C18: =AVERAGE(C13:C17) *or* C18: =AVERAGE(B13:B17) BTW: After using a column off to the right like this, change your print settings to NOT include it. Otherwise you'll get lots of extra paper. And you don't have to use column EA, it could be any empty column. You'd just have to change each instance of "EA" to whatever column you use in each formula. |
#20
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello,
I suggest to go this route: Example: Values in A13:D27: 1 1 13 1 1 2 14 1.5 1 3 15 2 1 15 2 15 2 2 4 16 2.5 2 5 17 3 2 6 18 4 2 7 19 5 19 4 3 19 5 3 8 20 6 3 9 21 7 3 10 22 8 22 5.5 Formulas in A13:D27: 1 1 =ROW() =IF(ISBLANK(A13),AVERAGE(B$13:B13),AVERAGE(INDEX($ B$13:$B $26,IFERROR(MATCH(C13-4,$C$13:$C$26,0),1)):B13)) 1 2 =C13+1-ISBLANK(B14) =IF(ISBLANK(A14),AVERAGE(B$13:B14),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C14-4,$C$13:$C$26,0),1)):B14)) 1 3 =C14+1-ISBLANK(B15) =IF(ISBLANK(A15),AVERAGE(B$13:B15),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C15-4,$C$13:$C$26,0),1)):B15)) 1 =C15+1-ISBLANK(B16) =IF(ISBLANK(A16),AVERAGE(B$13:B16),AVERAGE(INDEX ($B$13:$B$26,IFERROR(MATCH(C16-4,$C$13:$C$26,0),1)):B16)) =C16+1-ISBLANK(B17) =IF(ISBLANK(A17),AVERAGE(B$13:B17),AVERAGE(INDEX ($B$13:$B$26,IFERROR(MATCH(C17-4,$C$13:$C$26,0),1)):B17)) 2 4 =C17+1-ISBLANK(B18) =IF(ISBLANK(A18),AVERAGE(B$13:B18),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C18-4,$C$13:$C$26,0),1)):B18)) 2 5 =C18+1-ISBLANK(B19) =IF(ISBLANK(A19),AVERAGE(B$13:B19),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C19-4,$C$13:$C$26,0),1)):B19)) 2 6 =C19+1-ISBLANK(B20) =IF(ISBLANK(A20),AVERAGE(B$13:B20),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C20-4,$C$13:$C$26,0),1)):B20)) 2 7 =C20+1-ISBLANK(B21) =IF(ISBLANK(A21),AVERAGE(B$13:B21),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C21-4,$C$13:$C$26,0),1)):B21)) =C21+1-ISBLANK(B22) =IF(ISBLANK(A22),AVERAGE(B$13:B22),AVERAGE(INDEX ($B$13:$B$26,IFERROR(MATCH(C22-4,$C$13:$C$26,0),1)):B22)) 3 =C22+1-ISBLANK(B23) =IF(ISBLANK(A23),AVERAGE(B$13:B23),AVERAGE(INDEX ($B$13:$B$26,IFERROR(MATCH(C23-4,$C$13:$C$26,0),1)):B23)) 3 8 =C23+1-ISBLANK(B24) =IF(ISBLANK(A24),AVERAGE(B$13:B24),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C24-4,$C$13:$C$26,0),1)):B24)) 3 9 =C24+1-ISBLANK(B25) =IF(ISBLANK(A25),AVERAGE(B$13:B25),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C25-4,$C$13:$C$26,0),1)):B25)) 3 10 =C25+1-ISBLANK(B26) =IF(ISBLANK(A26),AVERAGE(B$13:B26),AVERAGE (INDEX($B$13:$B$26,IFERROR(MATCH(C26-4,$C$13:$C$26,0),1)):B26)) =C26+1-ISBLANK(B27) =IF(ISBLANK(A27),AVERAGE(B$13:B27),AVERAGE(INDEX ($B$13:$B$26,IFERROR(MATCH(C27-4,$C$13:$C$26,0),1)):B27)) Please note that I did not apply an average of averages but just a simple total average which I regard as correct (better). IFERROR(exp1,expr2) is an Excel 2007 function. In older versions you would have to write IF(ISERROR(expr1),expr2,expr1). Regards, Bernd |
#21
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks spiky but I just found out today I can't use my chart I have to use a
required chart but I tried it and it does work. Thanks again for your time and patience. It was all very helpful Bob -- mrbob16 "Spiky" wrote: I tried my solution in your file and it works, just plug it into the particular cells like I said above and then copy C13 to each cell where it belongs, and copy EA14 down as far as necessary (at least to EA59). And it will ignore the fact that the 6th row is different as long as you don't put anything in B18, B24, etc. I'm still not exactly sure what you want in the 6th cell, like C18, C24, etc. In different posts you've indicated 2 or 3 different ideas for these cells, and another in the file itself. I think one of these is all you are looking for, and it can be copied to each cell where you want it: C18: =AVERAGE(C13:C17) *or* C18: =AVERAGE(B13:B17) BTW: After using a column off to the right like this, change your print settings to NOT include it. Otherwise you'll get lots of extra paper. And you don't have to use column EA, it could be any empty column. You'd just have to change each instance of "EA" to whatever column you use in each formula. |
#22
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
No problem. That's how it goes sometimes.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A formula to AVERAGE IF but only average a set number of values | Excel Worksheet Functions | |||
Find monthly average but have average automatically configured | Excel Discussion (Misc queries) | |||
Error Handling #N/A with AVERAGE Function - Average of values in Row | Excel Worksheet Functions | |||
Weighed Average of a weiged average when there are blanks | Excel Discussion (Misc queries) | |||
how does one convert text to a formula "average(A:A)" to =average( | Excel Worksheet Functions |