Average Variable Number Of Cells
Oct 28, 2008
I'm once again here asking for a smart trick to do a difficult (for me) thing. I need to write a formula capable of averaging the n cells on its left. The problem is that the number of cells to be averaged is a variable contained in anothe cell therefore the exact number is not known (a priori) and changes at every sheet refresh.
View 3 Replies
ADVERTISEMENT
Nov 12, 2012
I am trying out VBA to write a macro in order to average every 25 cells in a column. My attempt so far is
Dim myrow1 As Integer
Dim myrow2 As Integer
myrow1 = 2
myrow2 = 25
Range("G2").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(R " & myrow1 & " C3:R " & myrow2 & " C3)"
myrow1 = myrow1 + 24
myrow2 = myrow2 + 24
So I am hoping the first ActiveCell.FormulaR1C1 gets read as =Average(C2:C25)
However I just get Run-time error '1004' Method 'FormulaR1C1' of object 'Range' failed.
View 3 Replies
View Related
Jul 2, 2014
I want to count the number of cells that have a value that is above the average of all of them. Ive tried the COUNTIF formula but no luck.
Sample attached : sample weds.xlsx‎
View 4 Replies
View Related
Feb 8, 2013
We are trying to track the average star values of reviews posted to our clients accounts. Here is an example of the spreadsheet we have set up:
Company Name
Review 1
Review 2
Review 3
Review 4
Review 5
Company 1
[CTY] 4 Stars review content
[ISP] 5 stars review content
[GGL] 4 stars review content
[CTY] 3 stars review content
[YELP]5stars review content
In this example, we use the initial [ ] to track which site the review was posted on ex: [CTY] means city search, [GGL] means google, etc.
We want to be able to track the average star value on each site. So the formula for City Search would scroll across the row of reviews, pick out reviews 1 and 4 and then find the first number in each and average them. The result in this case would be 3.5
From the research we have done so far, this looks like it will require a complex array formula. How to make this formula? Is this even possible what we are trying to do?
View 5 Replies
View Related
Mar 6, 2014
I need to find the cells that are greater than 48 and then find the average of this number.
Is there a formula that could put this together?
Average if greater than 48.xlsx
View 1 Replies
View Related
Mar 18, 2014
In my financial modelling I often have a calculated number of months of inventory. This number varies. I need to use this number to calculate the actual inventory value. For eg. it may be 3.2 months of inventory; in this case I need to sum 3 cells (current month, current month -1, current month -2) plus 0.2 of the fourth cell (current month -3)
But I may need to change the number of months of inventory to, for example, 4.2. In this case I would need the sum of four cells plus 0.2 of the fifth cell etc etc.
View 2 Replies
View Related
Dec 9, 2008
I have looked at many different examples of uses of the average function but I haven't found any examples of what I need it to do. Here is the code I am trying to use, but I am getting some errors.
View 6 Replies
View Related
May 1, 2009
I would like to have a cell in A2 sum up the values in cells A1, B1, C1 where the number of cells it sums is a variable in another cell that may change. I would like the same to apply to cell B2, C2, D2, etc.
This may make more sense if you look at the attachment.
View 11 Replies
View Related
May 29, 2013
I am trying to do the following.
Monday=0
Tuesday=5
Wednesday=10
Thursday=0
Friday=5
Saturday=0
Sunday=0
Averages
Monday=0
Tuesday=5
Wednesday=7.5
Thursday=0 (I have got a value return of 7.5)
Friday=5
Saturday=0 (I have got a value return of 5)
Sunday=0 (I have got a value return of 5)
I need to work out averages for cells higher than zeros, in other words, I need to ignore those.
Also say I have got an average of 5 by Tuesday and no number yet for the rest of the week, I still get an average of 5 for all days left which I do not want.
I am using excel 2003 and formula =SUM(RANGE)/COUNTIF(RANGE,">=0").
I would also like to hide the annoying #DIV/0! error.
View 9 Replies
View Related
Sep 15, 2014
I have two columns - A and B. In column A there are blank cells and filled cells. There is a blank cell and after it - a variable number of filled cells, then a blank cell again and a variable number of filled cells. I am trying to concatenate the filled cells from column A into a single cell in column B, which is corresponding to the blank cell in column A. Values should be comma delimited.
For example: A2-blank; A3-27; A4-63; A5-blank; A6-31; A7-blank .. and in column B should be B2-27,63; B3-blank;B4-blank; B5-31,B6-blanc and etc.
View 5 Replies
View Related
Sep 19, 2009
Here’s an example of my data:
A B
1110AAAAAAA
2220BBBBBBBB
3330CCCCCCCC
4330DDDDDDD
5330EEEEEEEEE
6440FFFFFFFFF
7440GGGGGGG
8550HHHHHHH
I need your help to figure out how to merge the above data to look like this in new blank worksheet using a VBA macro:
A B
1110AAAAAAA
2220BBBBBBBB
3330CCCCCCCC
DDDDDDD
EEEEEEEE
4440FFFFFFFFF
GGGGGGG
5550HHHHHHH
View 10 Replies
View Related
Aug 8, 2009
On the attached Excel file, I have code that will insert a variable number of rows and copy and paste from and to variable positions. That all works fine when run from a command button, but when I try to run it from the Worksheet_Calculate by entering 1 in J1 or K1 (inrange cell is J1+K1 for testing purposes) the CommandButton1_Click sub runs continously until an error occurs.
View 4 Replies
View Related
Jun 14, 2013
E11 through E24 contains numbers and a few errors (#N/A) that need to persist (the errors need to show).
E10 needs to show the average of the numbers that are in E11 through E24, and just ignore the errors.
I have many columns like that - where the errors need to show and I need to show an average of the number/values that do appear, ignoring the errors.
View 14 Replies
View Related
Jan 27, 2009
I've attached a sample worksheet. I have a series of time values in ascending order (column A) and then 5 sets of data that correspond to the time values. I wish to be able to enter a minimum and maximum time range then selectively average the numbers from the sets of data that fall within the time range, but I can't think of a simple way of doing this.
View 5 Replies
View Related
May 26, 2008
I have a formula: =SUMPRODUCT(($D$18:$U$18>=$V$18)*($D$18:$U$18
View 9 Replies
View Related
Dec 18, 2009
I'd like to calculate an average over a variable range. In col.A there are grades from A4:A21. In col.C there are the values for the start row of the range and in col.D the values for the end row of the range.
For instance the value in C4=4 and D4=9. In cell F4 I want the average calculated over A4:A9. Value in C5=10 and D5=15. In cell F5 I want the average calculated over A10:A15.
View 2 Replies
View Related
Dec 13, 2008
Hi there, been using this for a number of years now, but never had to post a question - I guess most things are already answered - but this one is a bit more tricky.
I want to calculate a totals and a weighted average based on months from a data set that has duplicate ID's and variable data (attached example).
I would like to calculate the total tonnes by month and the average grade of those tonnes. Using the 'month ID table' as a reference to the 'Raw Data table'.
Is this possible using if and vlookup functions or will require a higher level of programming knowledge?
View 6 Replies
View Related
Jun 7, 2013
Cell D39 has the formula
=(D4+D11+D18+D25+D32)/5
I want the cell to remain blank until at least on variable is entered, but then I want it to calculate the average of only the cells that have a variable in them.
Just so I am clear
D4 = 20
D11 = 50
D 18 = BLANK
D25 = BLANK
D32 = BLANK
Average would be 35
View 4 Replies
View Related
Jan 4, 2014
I am working with Excel 2010 and I have a problem that I can't seem to figure out. I am trying to find the first nonzero cell and begin an average function from that cell and down through 29 rows (a total of 30 rows).
Sub average()
FinalRow = Cells(Rows.Count, 3).End(xlUp).Row
For I = 3 To FinalRow
If Cells(I,3).Value 0 Then
'I use the above to identify the first nonzero cell
ActiveCell.FormulaR1C1 = "average(........)
This is where I am stuck, I don't know how to code the first nonzero (which can change with different data) cell and average rows below it.
View 7 Replies
View Related
Apr 28, 2014
I'm trying to calculate the average for a range that begins with cell B15 and has various end points, depending on the day (since I'm pulling 2 actual years of data that strips weekends and holidays, as opposed to going back a set amount of days/years). Syntax for cell B4 to reflect the average of range B15 to LastRow? I tried several things and it didn't work. Rows 1-12 are being reserved for the summary calculations that will then be pulled into the final Dashboard.
View 1 Replies
View Related
Mar 11, 2008
I am using a variable named " Totals" as a range type to refference the range in a formula. It works the way I have it.
Dim Totals As Range
Set Totals = [U37: AE37]
Now instead of the absolute refference, I would like to change the row refference by an offset of my current row, using a formula with a varriable. The columns stay the same.
View 3 Replies
View Related
Jan 7, 2010
i was given a formula in B15 which allows me to get the average of the figures that are submitted within that box not all 28 squares will be used hence the formula but this leaves me a #DIV/0! if no numbers are inserted.i need to get the average of all 7 boxes for totals but cant why i have this error there how can i oberride this so if all the boxes are blank it reads nothing
View 13 Replies
View Related
Aug 17, 2008
I am looking for a sum if formula to average the numbers in column 2 but only if the number isn't 0, so the average of CARLING will be 12.5 and not 8.3
View 9 Replies
View Related
Sep 25, 2009
I would like to find the average number of days events take from start to finish.
My data is in 3 columns:
EventName StartDate EndDate
I have a ton of EventNames, each of which have a StartDate. But I want to calculate the average days to complete only for those EventNames that have EndDates.
So, if a cell in the column EndDate is greater than zero, then take that cell, subtract it from the corresponding cell in the StartDate column; Add all of them together and divide by the count of those rows in the EndDate column that have a value.
How do I put this in excel terms? ....
View 3 Replies
View Related
May 17, 2009
In a grade book, if students get a grade on the final exam that is higher than the midterm grade, this becomes the exam portion of their (if it's lower, it's averaged). So a student who gets an 81 on the midterm and a 90 on the final gets a 90 for the exam portion of the final grade. What's the easiest formula to make the final exam grade the average if it's higher than the midterm grade?
Right now the formula I use for the course grade is this:
=SUM(I3*$I$1)+(J3*$J$1)+(K3*$K$1)
where I3/J3/K3 are the midterm/final/quiz averages, and I1/J1/K1 represents the respective % (30/40/30) of the grade assigned to the midterm/final/quizzes.
View 9 Replies
View Related
Jul 17, 2014
What I want to do is Average out a range of cells "F4:F343". That's the easy part =average(F4:F343). However I want to exclude any numbers for that average if data in coloumn "Q" = "FMC"
Would that look anything like:
=average(F4:F343)/countif(Q4:Q343, "<>FMC")
I'm also displaying it as minutes in a day so i added *24*60 to the end of the formula and formatted to Number/.00. I've entered the formula and it will calculate but when i enter FMC to the appropriate area the average wont change.
View 2 Replies
View Related
Nov 15, 2007
I have a worksheet containing 5 columns. A start and end date, a number of days between these dates, the quarter number of the start date (i.e. 1 to 4) and then the year.
I want to calculate the average number of days per quarter so an average of days in column C, based on the details in column D and E.
View 11 Replies
View Related
Jan 24, 2010
In the sample book attached I need to:
* Calculate if the numbers on J2:J4 are within 30% of each other (which I do and the results are in the table in O1:Q4.
* The numbers in J2:J4 (and accordingly the results from O1:Q4) change when the numbers in F2:F4 change
* In M2 I need to calculate the average of only the numbers from J2:J4 that fall within 30% range from each other. In the example attached, I need to average only J2 & J3.
I thought about 2 ways:
A multiple IF formula or an Averageifs formula.
The multiple ifs formula below works fine except when all 3 numbers are either within or out of30% range.....
View 12 Replies
View Related
Mar 26, 2014
I need a formula to determine the average number of days between sales transactions for each item in inventory. There are several hundred different item numbers with thousands of transactions.
I have attached an example of what I'm looking for. I've toyed around with Average and If functions but can't seem to get it right.
Avg Number of Days - Excel Help.xlsx‎
View 1 Replies
View Related
Jun 29, 2006
I am trying to find a formula that works out the average of the figures in column K.....my problem is that so far in column K there is only one positive number (11)- the rest of the cells are DIV/0 so the average is showing as DIV/0. This is incorrect as the average is really 11 - how can I sort this out with a formula?
View 9 Replies
View Related