Excel and consecutive number

Is there a way to have excel locate a set number of consecutive non-zero 
numbers and give me an average of those numbers?
trying to get around this problem:
5 largest consecutive non-zero numbers of the last 10 non-zero terms
hope there is some help out there for me
0
Utf
5/1/2010 2:29:01 AM
excel.worksheet.functions 4936 articles. 2 followers. Follow

2 Replies
1614 Views

Similar Articles

[PageSpeed] 10

If I understand what you want correctly, here is one method. Assuming you 
have a list of numbers in column A with the first number in row 2:

Enter this formula in B2 and copy down through all rows of data:
   =IF(A3=0,0,IF(B2=10,10,B2+1))
This formula counts consectuive non-zero numbers in column A.

Enter this formula in C11 and copy down through all rows of data:
   =IF(B11=10,AVERAGE(LARGE(A2:A11,{1,2,3,4,5})),"")
This is an array formula which must be entered by pressing CTRL+Shift+Enter
and not just Enter. If you do it correctly then Excel will put curly brackets
around the formula {}. You can't type these yourself. If you edit the formula
you must enter it again with CTRL+Shift+Enter.
This formula averages the 5 largest in every group of 10 consectuive 
non-zero numbers.

Enter this formula in D1 to get your final result:
   =INDIRECT("C" & MATCH(1E+300,$C:$C))
This formula returns the last number in column C (the final average computed).

Hope this helps,

Hutch

"Shadowkiller361" wrote:

> Is there a way to have excel locate a set number of consecutive non-zero 
> numbers and give me an average of those numbers?
> trying to get around this problem:
> 5 largest consecutive non-zero numbers of the last 10 non-zero terms
> hope there is some help out there for me
0
Utf
5/3/2010 7:38:52 PM
Trying it right now with a small set of numbers starting in A2.  numbers go 
down to A11 in the order of  1,0,2,3, 4, 5, 6. 7, 8, 9.  Entering in your 
formula in B2 i'm getting a zero and with the zero formula #2 (C11 array) 
doesn't show up and formula #3 in showing N/A in D1.
i must be doing something wrong but i don't know what it is...

"Tom Hutchins" wrote:

> If I understand what you want correctly, here is one method. Assuming you 
> have a list of numbers in column A with the first number in row 2:
> 
> Enter this formula in B2 and copy down through all rows of data:
>    =IF(A3=0,0,IF(B2=10,10,B2+1))
> This formula counts consectuive non-zero numbers in column A.
> 
> Enter this formula in C11 and copy down through all rows of data:
>    =IF(B11=10,AVERAGE(LARGE(A2:A11,{1,2,3,4,5})),"")
> This is an array formula which must be entered by pressing CTRL+Shift+Enter
> and not just Enter. If you do it correctly then Excel will put curly brackets
> around the formula {}. You can't type these yourself. If you edit the formula
> you must enter it again with CTRL+Shift+Enter.
> This formula averages the 5 largest in every group of 10 consectuive 
> non-zero numbers.
> 
> Enter this formula in D1 to get your final result:
>    =INDIRECT("C" & MATCH(1E+300,$C:$C))
> This formula returns the last number in column C (the final average computed).
> 
> Hope this helps,
> 
> Hutch
> 
> "Shadowkiller361" wrote:
> 
> > Is there a way to have excel locate a set number of consecutive non-zero 
> > numbers and give me an average of those numbers?
> > trying to get around this problem:
> > 5 largest consecutive non-zero numbers of the last 10 non-zero terms
> > hope there is some help out there for me
0
Utf
5/3/2010 9:17:02 PM
Reply:

Similar Artilces:

Excel #27
i am doing a worksheet and need to know what a page in a spreadsheet is called. it begins with W. x EggHeadCafe - Software Developer Portal of Choice Self-Updating Service Command Pattern MSMQ Invoker http://www.eggheadcafe.com/tutorials/aspnet/56da6071-0b12-4c99-986f-ce836e2d32e0/selfupdating-service-com.aspx I'm fairly certain that it was explained on the first page of your reading assignment. Charlie wrote: > i am doing a worksheet and need to know what a page in a spreadsheet is called. it begins with W. x > > EggHeadCafe - Software Developer Portal of Choice > Self...

Excel 2007 #11
I want to protect a sheet but still allow users to use the AutoSum feature on unlocked cells. Apparently this isn't possible? Doesn't make much sense, given that you can enter other formulas from the Function Library. ...

Excel cell format
I have quaotes around one of my cell, I have Rodgruiz, JR in the cell and it is defined as a text field. why is it putting quaotes around my name -- AG Try clicking on the cell press F2 and enter then delete quotes if the are still ther -- scottymellot ----------------------------------------------------------------------- scottymelloty's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=380 View this thread: http://www.excelforum.com/showthread.php?threadid=31450 ...

Scripting Excel with Python via appscript
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Hi, <br> has anyone else here used Python as a scripting language? One of the (maybe unintended) consequences of MS making Applescript the only scripting possibility is that through AppScript (http://appscript.sourceforge.net/) one can also use Python (and Ruby and Cocoa/Objective C). <br> This allows for great new possibilities (just think of the many libraries available for Python), although I have three issues: <br> 1) being used to Excel's VBA api I still have to adapt to the AS dict...

Date format in Excel 2000
Hello, I am attempting import a text file into Excel 2000. The text data is set as YY/MM/DD format, and I would like to keep the same format in Excel. Excel automatically converts the date into MM/DD/YYYY format, even though I select general on the formatting tab when doing the import. Is there a way to have this field ignored so that my raw data can stay in it's original format? Thanks, Scott Hi try preformating this column with your date format -- Regards Frank Kabel Frankfurt, Germany "Scott" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:1...

Entering 18 digit number in Excel
Dear All, I am trying to enter a 18 digit number in one cell. Surprisingly, the lasst two digits are automatically being changed to 00. The number i tried to enter is - 857013340418093014. The last two digits i.e. 14 is automatically changed to 00! Could any one of you please help. Thanks & Regards, Jaipal Singal. <jaipal1@gmail.com> wrote in message news:50262a6f-d859-42c2-9171-494650141076@l28g2000prd.googlegroups.com... > Dear All, > > I am trying to enter a 18 digit number in one cell. Surprisingly, the > lasst two digits are automatically being changed to 00. &g...

Copying numbers from Excel to Word
Hi, I have numbers in Excel formated in Hebrew font Narkisim.When I copy them from Excel to Word (2003 and 2007) it converts the numbres to Times New Roman and force them to be formated as ENGLISH charachters instead of HEBREW. Is it a bug? Thank you, Tamir :-) __________ Information from ESET NOD32 Antivirus, version of virus signature database 4762 (20100111) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com Hi Tamir, If you paste the numbers into a Word range formatted with the Narkisim font, I'd expect them to retain ...

Excel does not print
A few of my users have the problem in excel when they attempt to print, the job goes to the printer spool (I can see it appear and quickly disappears) but never prints. Users get no errors or any other indication that the file does not print. Has anyone else experienced this problem, or know a possible fix? Jeff Hi does this happen only with Excel documents? -- Regards Frank Kabel Frankfurt, Germany "Jeff" <jeff4379@news.postalias> schrieb im Newsbeitrag news:#IcJGVX2EHA.1124@tk2msftngp13.phx.gbl... > A few of my users have the problem in excel when they attempt to p...

excel vba
Basically, what will happen is they click the save/print commanbutton o the sheet, this brings up a userform asking them yes or no, what wil now happen is when they click on either yes or no commandbuttons, want a code to recognize if one of the four option buttons on the shee has been selected, if one has been selected it will run its course. I not, it will close the save/print userform and select cell "K5" fo example whereby they can choose an option button and move on. What would be the selection recognition code that i could store in m save/print userform? thank -- Message p...

Excel 2000 autosum not adding correctly
I use Excel 2000 and have been for some time. Today I placed dollar amounts in a column and then hit autosum. I was given a total of $5887.70. I then added the last numbers in my head and also a calculator and the total was $5887.71, off by 1 on the last digit. I tried numerous times getting the same results. All of the cells have been formatted for currency with 2 decimal points. Does anyone have an explanation? Sure. What are the ACTUAL values in the cells? If you've got values like 123.456, these are rounding up. Instead of using formatting to round the cells, round them ...

Excel formula help #2
I am VERY new to spreadsheets! Is there a formula that will calculate the % change in my investments from one entry to the next? In other words, if January's value of a stock is $10, and February's value is $12, and March's value is $6, can I get a cell that will show a 20% increase for Feb, and change to (50%) loss when I enter March's value? I hope this is clear! Thanks for any help! Susan Hi Susan, Very clear! assuming Jan in A1, Feb in B1, Mar in C1, etc. enter this in B2 =(B1-A1)/A1 and format as a a percentage, then just copy across If you want to setup ...

coloured numbers
hi all i have a sheet that consists of 7 coloums and unlimited rows, i need to colour a group of numbers so that when they appear they turn a certain colour. tried to do it in conditional but this only allows me to use 3. any help would be appreiciated. jkf jkf schreef in news:I_tip.193061$up7.104215@newsfe04.ams2 > i have a sheet that consists of 7 coloums and unlimited rows, i need > to colour a group of numbers so that when they appear they turn a > certain colour. tried to do it in conditional but this only allows me > to use 3. any help would be appreiciated. Here&#...

Is there a way to format numbers to show as degrees farenheit?
I am trying to format a list of numbers and have them formated in degrees farenheit...with the little degree symbol at the end of the number...can this be done and if so please tell me how? Many Thanks! Something so simple, but so frustrating! The degrees-sign is, depending on your font, Char(176) or Char(186) You need to get that into the Custom format, after a zero. One way: in a cell, enter =CHAR(176). Copy the cell and paste the symbol into the Type box of the Format Custom dialog. Another way to enter the symbol is to keep the Alt-key pressed while type 0176 on the numeric ...

"Disk Full" Message from Excel 97
Two users with Win 98 SE systems running Excel 97 with current SR updates. They are part of a Windows 2003 domain. Occasionally, when they go to save spreadsheets to a network share they get a message saying "disk is full". The disk, in this case, is definitely NOT full. The problem only happens occasionally and it never happens with Word documents. Has ayone come across this problem before? Thanks. Hi John You receive the "Disk is Full" error message when you save a workbook in Excel http://support.microsoft.com/default.aspx?scid=kb;en-us;214245 Error Messa...

runner's log in excel??
Does anyone know of runner's logs that are set up in excel? ...

displaying numbers in a cell backwords
i want to display some numbers in a few cells backwords for example i want a cell that has 1234 in it to say 4321 with out changing it manually. i have a lot of cells that i need to change is there any esier way? If you only have 4 numbers this is the easiest way!! =RIGHT(B3,1)&MID(B3,3,1)&MID(B3,2,1)&MID(B3,1,1) Hope that helps! Michael: -- Message posted from http://www.ExcelForum.com Hi see http://tinyurl.com/363po -- Regards Frank Kabel Frankfurt, Germany "Hillary" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:18af01c43f81$9325b6...

Trouble using solver with Microsoft Excel 2007
I have made several attempts to get solver to work on Excel 2007. I keep getting an error stating I need a VBA converter. Anyone have suggestions. I tried updating to service pack 1 with no better success. I have tried reinstalling the program and have searched the knowledge base. ...

Unable to open Excel file #4
Error message: File cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding. The file was not saved as read-only and the file is on a diskette. Sounds like a bad disk. Copy the disk to the hard drive somewhere an try to open there. -- kkkni ----------------------------------------------------------------------- kkknie's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=754 View this thread: http://www.excelforum.com/showthread.php?threadid=26520 Vic Cop...

Oops sent to wrong forum: Excel Macros
Hi: I have a workbook with 14 worksheets. I need 14 macros I want the name of the macro to be the name of each worksheet. ex. FA2E, FA3E, FA4E, etc. the macro is the same except for referencing the worksheet name. I have the first macro and am copying/pasting 14 times, changing the worksheet name and macro name. However, it doesn't work properly. About the 5 copy/past excel seems to want to call the macro by the name of the workbook, dot, worksheet. What am I doing wrong. When I open up tools, macro, I want to see the 14 names as stated above. Because, I have a final macro th...

Excel Macro #2
Excel tip needed. I "recorded" a quick little macro for an Excel report and now I want to send this file out to customers. But everytime you open it, you are asked if you want to disable or enable the macros due to viruses. Is there a way to keep this macro, but not have customers get this message? Thanks! Hi Derek! No need to post to more than one group. This involves changing your customer's security settings. Post the details of the macro and it might be possible to achieve the same objectives without it. -- Regards Norman Harker MVP (Excel) Sydney, Australia njha...

Counting in Excel #5
Got it! Thanks to all of you for your help -- Angel16 ----------------------------------------------------------------------- Angel160's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1550 View this thread: http://www.excelforum.com/showthread.php?threadid=27561 glad to help -- Don Guillett SalesAid Software donaldb@281.com "Angel160" <Angel160.1f98km@excelforum-nospam.com> wrote in message news:Angel160.1f98km@excelforum-nospam.com... > > Got it! Thanks to all of you for your help. > > > -- > Angel160 > ---------------...

FAO Conrad Calberg (Excel Sales Forecasting...)
Hello, I just bought your new book. To my dismay I found out that the data files used in the book are NOT available, nor is your contact (both in book and publisher's website). I am not keen on using newsgroups so I do not know where to locate u; I suppose you use them since u mention them in your book. If you happen to see this, please reply as I am in very much need of the book's data files! If anyone who reads this can help, I would appreciate it a lot. Thank you Why don't you write to the publishers? -- HTH Bob Phillips <d.stephanou@gmail.com> wrote in message...

Excel concatenate multi cells problem
I have 5 cells that I wisk to concatenate. Each cell currently contain 1-5 words within it. When I concatenate I want commas separating eac value with double quotation marks at the start of the concatenated cel and at the end. See below What I have: A B C D I need Help with this problem What I want: F "I need, Help, with, this, problem -- Message posted from http://www.ExcelForum.com Jamiew1, here ya go: =""""&A1&", "&B1&", ...

Help with Formula in Excel 2003
I have a column of data which I add to twice a day for one month. I have a second column which calculates the daily average. I need to calculate the difference between the last entry in the average column & the first, placing the result into another cell. What I can't find is how to make this a dynamic update. Any ideas please? =AVERAGE(H2:OFFSET(H2,MATCH(9999,H:H),0)) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Andy" <Andy@discussions.microsoft.com> wrote in message news:418C8345-4A2E-42F2-8A0E-43FF1BC2BD13@microso...

Finding the biggest number out of 8 variables
Hi All Does anybody know of an easy way to find out which variable has the highest value out of 8 variables? For example, I have these values in 8 vars: 3 0 7 30 37 17 0 7 Although from a human's perspective it's easy to see that the 5th var has the highest value, how can I chose the appriopriate var programmatically? Thanks There are many solutions. You could put the values into an array and pass the array to a QuickSort routine. The QuickSort algorithm is difficult to understand, but you really don't need to know how it works. See: http://vbnet.mvp...