Averaging Dynamic Range Of Cells Across A Row

Feb 17, 2014

I have a row of dates going across in row 2, and random values going across in row 3 from D3 onwards. I want to return the average of values in row 3 until the third last non-blank cell in row 2 and do a similar thing for maximum row but just for the last 30 cells from the right (so latest 30 days). I have attached screenshot of part of spreadsheet for better illustration.

Capture.PNG

In my macro I can come up with a range for both, as below. Both lines of macro below select the correct range I am looking for.

[Code] .....

However when I try to apply them into an average/maximum function they returned an error 1004, Application defined or object define error:

[Code] .....

When I put it as following it returned me the value of Cells (3, 4) (Cell D3) instead of the average:

[Code] .....

Attached File : Capture.PNG‎

View 8 Replies


ADVERTISEMENT

Dynamic Averaging Based On Adjacent Column?

Nov 2, 2013

I have a column with random values that are generated my my machinery.I should not sort them, because they provide me with the performance graph. Lets say i have column "A"

0
2
9
9.5
30
90
22
15
9
0

As the max value of this is 90, and its 10% of MAX is 9, which occurs at 3rd and 9 th positions.I need to find the average of its adjacent range, with zeros not considered.It has to calculate the max value in the column, find 10% of max and do average of adjacent column from the sl. no of first occurrence of 10% value in first column to the sl no of last occurrence of 10% value in first column.

the exact 10% value may not always exist. 10% of 90 is 9, but if the max value is 94, the 10% would be 9.4 which doesn't exist. then it has to take the nearest available predecessor in that case.i get values in decimals mostly and only some of them are perfect integers, thus this consideration goes with it,and also, my range actually is B14:B10013

i would most probably have the 10% value within the first 50 "non zero" entries and reoccurring somewhere probably within the last 50 "non zero" entries.

View 7 Replies View Related

Dynamic Named Range Sort Including Cells Outside Defined Range

Apr 3, 2008

Im sorting a dynamic range as mentioned in this Sorting a Named Range. My range is called drWarningTypes and is defined as:

=OFFSET(DataSource!$A$2,0,0, COUNTA(DataSource!$A:$A)-1,1)

When there is only one cell in the range, then running the following sort function includes A1 also in the search (and also adjoining columns).....

View 9 Replies View Related

Copying Range Of Cells Under A Dynamic Range Of Cells

Jul 30, 2006

I got a range of data on sheet2, size changes everyday (dynamic) And in sheet1. I got a range of data and the size changes everyday as well. I need to copy the range in sheet2 to sheet1. The position would be at the cell after the last data in sheet1. e.g.

sheet1 got 105 data
I need to paste data of sheet2 start of row106 in sheet1

View 6 Replies View Related

Select Dynamic Range Of Cells

Feb 9, 2008

I need to select data starting from cell 16B until 16K until the end of excel file... i will use this to export data into database later... I have attached a sample excel file with records needed to be selected

View 3 Replies View Related

Averaging Range With Lookup

Mar 21, 2014

TimeForce
00.2
0.50.5
11
1.52
24
2.54
34
3.54
44
4.54
54
5.54
64
6.51
70.3

for example i have this data I want to average range of some values in force column for which i only know range of values in TIME column..

For Example I want to average the values for which the values in time column are 0 to 1.5 ((0.2+.5+1+2)/4)

I deduct a formula but it is giving error AVERAGE(LOOKUP(0,A:A,B:B):LOOKUP(1.5,A:A,B:B))

View 7 Replies View Related

Averaging Value Over Variable Range

Nov 10, 2011

I have two columns. The first is a timestamp that comes in 15 minute intervals. The next is a column of mostly zeroes with occasional peaks (I think of 10,000, but it could change). I'd like to average the peak value out over the range of zeroes before it. The peaks aren't coming at regular intervals.

View 2 Replies View Related

Populate Cells Using Dynamic Named Range VBA

Sep 25, 2011

I have a sheet containing 2 lists of categories for income and expenses. These lists are named inc and exp, respectively, and are contained in a sheet called "Lists." They are dynamic ranges, meaning every time a value is added, the named range adjusts itself to include the new value(s). [=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)]

I have 2 tables summarizing 12 months of data. The tables use sumif to find all occurrences of each category and sum them. There's 1 table for income, 1 for expenses. Each is a 2 column table, with all the categories for income in column A and their total for 12 months in column B. Same for Expenses in D & E.

To populate the categories in column A & D, I am currently using the simple =Lists!A1 =Lists!A2 (inc range), =Lists!B1 =Lists!B2 (exp range) and so on... the problem is when a value is added to either list, while the named range adjusts, I have to manually drag the formulas in Column A & B down 1 more cell to include the new value.

How can I use VBA to look for the inc and exp ranges (which will change in size), then populate each table with the most recent categories?

View 9 Replies View Related

Count Number Of Cells In Dynamic Range In VBA?

Jul 23, 2013

I have a function which copy pastes data into a sheet based on a filter criteria. It is also pasted in a specific layout(shown below) starting from Cell A1 in the top left corner. Therefore the destination sheet could have a different number of rows with values each time.

What I would like to do is count the sum of 'Values' in the destination sheet, and add a total below it.

For example, the [=TOTAL] cell is where I want the total to appear. Below the answer would be 26. But say if Peter wasnt in the record, the formula should still work in identifying the Total as 20.

Title:
Sheridan
Owner
Petrov G

[Code]....

Is there a way I can achieve the desired result? I figured I had to somehow count from the first record by Peter, to the last one, whichever that may be.

View 2 Replies View Related

Dynamic Range To Look Past Blank Cells

Aug 11, 2008

I am having the same problem as this thread Dynamic Ranges with blank cells.

I've recently been pointed in the direction of dynamic ranges (named ranges that use OFFSET and COUNTA to expand to cover the whole of a list, even if the number of rows used is frequently changed).

They seem to have a big drawback, in that the range will not go to the bottom of the list if the list has blank cells in (because the COUNTA for the column of interest does not equal the number of rows in the list).

A typical named range might look like this:

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$25),1)

I tried to post in it but it's too old.

I have been to the link posted in that thread about advanced dynamic named ranges but inserting a row with numbers in it and then hiding it is not suitable for me as i deal with other peoples spreadsheets so need to always be working with the Active Sheet.

View 4 Replies View Related

Macro For Average Of Values - Dynamic Range Of Cells

Aug 1, 2013

I need to find average of the values , the count of the cells will be dynamic (may be 5 or even 200).

View 2 Replies View Related

Copy / Paste Dynamic Range Of Cells With Data From One Day

May 28, 2014

I have a range of cells with data from one day. This range is "C36:K63"

Each day, the prior day's range needs to be copied and pasted into a new range that begins two rows below where the prior day's range ends.

Thus, day two should copy "C36:K63" into a new range: "C65:K92"

As you can tell, the rows will change each day, but the columns will always remain the same.

How can I create a macro that allows a user to copy data from the most recent range and paste it into a new range?

i.e. if there is no data in C65:K92, the macro should copy the data from C36:K63 and paste it into C65:K92. Then, the next day, the macro would copy the data from C65:K92 and paste into C94:K121.

View 2 Replies View Related

VBA Dynamic Range Till First Blank But Cells Contain Formula?

Jul 22, 2014

I've normally just dynamically selected a range using the xldown feature but because this row contains formula it goes always down to the bottom of the formula instead of the last cell which isn't blank.

How would i go about generating this dynamic range that stops at the first cell that contains no value (but has a formula)? Perhaps a do while loop which looped down until it hit the first blank and then assigned the cells it had looped through as the range?

View 3 Replies View Related

Select Dynamic Range Based On Non-empty Cells

Aug 7, 2009

I require code to identify the last row in column 'A' that contains data, and then to select every row up to that one, and each column up to 'H'. My data begins on row 3, and the rows with data varies from row 7 through 120. The columns with data is constant so there is no need to test in that direction.

View 2 Replies View Related

Naming Dynamic Range Of Cells Based On Heading

Apr 15, 2014

I need to name a dynamic range of cells. The only constant is the column - H, and the heading "MRC".

MRC column in a table represents an array formula. Unknown is the row where it is going to show up and the number of rows that this array formula will take. I need to name this range (active cells based on the array formula) but do not know what row does it start with and how many rows will it take.

It is not the last table in column H either but there are 2 empty rows before the next table.

Trying something like that...

=========================
Set aCell = Range("H:H").Find(What:="MRC", LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then

aCell.Offset(1, 0).Select
========================================

That's how I select the first cell in the range. Not sure how to select the whole range and name it ..
ActiveCell.End(1xDown) ?

View 3 Replies View Related

Select All Cells In Semi-populated Dynamic Range

Aug 16, 2006

I have a range of data in columns A2 to Mx. The length of the columns varies, and all cells are not always populated. I want to be able to select the entire range, no matter what its length, no matter how many cells are populated (as both of these will vary on each tab) However, I do not want to select A1 to M1 as this is column headers which need to be excluded from the data for compliation purposes.

View 9 Replies View Related

Adjust Dynamic Range To Ignore Formulas In Blank Cells?

May 19, 2014

Attached is a spreadsheet I am working on that has a series of graphs with defined dynamic ranges. I am having 2 separate issues on 2 different tabs.

1) Ranges named AirRecBra4 (and Bra10); AirComBra4 (and Bra10); AirRemBra4 (and Bra10) are not pulling in data from the correct data points. Instead of using the last 26 data point, they are currently beginning at the top of the column (currently cells 11 to 36 is their respective columns). The formulas are copy and pasted from working offset ranges in the same tab but are reading differently.

2) On the last 6 tabs beginning with Stn Backlog, I want to have defined formulas beginning in cell B119 and continuing downward to at least F200. However, when I add the formulas, the offset reads the formulas as being data and adjusts for that. I do not know how to adjust the dynamic range to ignore formulas in blank cells.

Global Demand-Capacity Management_working (version 3).xlsm

View 6 Replies View Related

Dynamic Named Range - Select Only Cells With Numerical Values

Jul 21, 2006

Is anyone aware of some way to use the " dynamic named range approach" to only select the cells with numerical values in a column and name this range?

I've looked at the examples on this site but can't find any solution to this particular problem although I have a feeling that this should be possible.

View 9 Replies View Related

Averaging Different Cells From Specified Categories?

Mar 17, 2014

I want to average cells in different columns which meet a minimum criteria, i.e. > 2.0, from specified categories list in the first column. Example: I want to select a category listed in column A and average the numbers listed in columns C and F for that category which meet a minimum threshold.

View 9 Replies View Related

Averaging Cells Across Several Sheets

Jul 1, 2006

I have done alot of research in the formula realm but haven't ventured into the VBA coding side of the house due to the inexperience. I'm having issues w/ a particular calculation and hoping you all can help me out.

I hope I can explain this well.

- I have a total of 31 sheets (1-31)
- In each sheet there is a series of number (B16:L16)
- I want to take the average of all these numbers

I'm able to get the average of each sheet then take the average of those but that is not what I'm trying to do because of the following problem.

Let say in sheet1 that 5 cells are filled from the series (B16:L16) but on sheet2 there is only 1 cell filled and on sheet15 there are 10 of the 11 cells filled.

When you take the average of each sheet than average that it will not come out with the correct calculation. I'm trying to average ALL numbers combined from Sheet1 to 31 from cells B16:L16.

How can I do this. I have tried several solutions but nothing working properly. This is the one I have tried but doesn't work properly:

{=AVERAGE(If(ISNUMBER( '[Jul06AMEFVER.xls]1'!$B$15:$L$15),ABS('[Jul06AMEFVER.xls]1'!$B$15:$L$15)))}

However when I try to ":31" after the 1 it will not provide the correct value. Not sure where to go with this.

View 9 Replies View Related

Averaging Selected Cells Excluding Zero

May 13, 2009

I wanted to average selected cells excluding the value zero. Also, I wanted to make the value of cell is zero and not to display the error #DIV/0! if the denominator is zero.

A1 = Denominator

Selected cell:
A3, A5, A6, A8

View 14 Replies View Related

Summing/Averaging Last 5 Rows (cells)

Sep 14, 2009

I was trying to sum/average last values in a range. If the range is updated, it should sum/average the last 5.

Tried to do it myself but succeded to do my head in only.

View 9 Replies View Related

Averaging Data Not To Include Null / Zero Cells

Mar 10, 2014

I am having difficulty trying to solution this:

Row 1 = Dates e.g. 1-Mar - 31-Mar
Row 2 = Day of Week e.g 1-Mar(B1) = Sat(B2) through 31-Mar ending at (AF)

Column A has hourly time intervals
A3 = 0:00
A4 = 1:00 etc to 23:00

Numbers fall into cells by date/day and interval up to today 10-Mar

What I am trying to do at is average the days separated by Weekdays and weekends..so the formula at AG for interval for weekday would be =AVERAGE(D3:H3,K3:O3,R3:V3,Y3:AC3,AF3) weekends (Column AH)would be =AVERAGE(B3:C3,I3:J3,P3:Q3,W3:X3,AD3:AE3)

I want to average the weekdays and weekend numbers without having to group the weekdays and weekends in a custom sort in the final column. That way when I add the data every day, it auto calculates in AG and AH. If I do it as it shows above, the AVG is skewed due to the blank cells.

Attached a sample worksheet.

View 4 Replies View Related

How To Name A Dynamic Range & Make A Validation List (of 2 Dynamic Ranges)

Dec 22, 2009

I have a range which will change in size & in content, & I want this to be a Named Range at whatever size it is.

Reason I want to is because I want to make a Validation List with this dynamic range. I also want a Validation list which lists the content of 2 or more dynamic ranges which may or may not be on the same worksheet - is this possible?

i.e.
First dynamic range: called "Milestones" at A11
Second dynamic range: called "Activities" at A25
& make a Validation list that will list content of both

View 9 Replies View Related

Adding Constraints To Averaging Formulas Over Multiple Cells

Nov 20, 2009

I have data for 500 companies over 10 years, in three criterions: “EPS”, “DPS” & “PX” (i.e. earnings, dividends and price).

For each company I have four lines recording the data, and given a letter code indicating how the change in dividends and earnings have been according to the following

(Examples)
DD-ED = Dividends Decreased & Earnings Decreased
ND-EI = No Dividends & Earnings Increased
As can be seen below this code is present for each company

What I need help with is some sort of lookup function which takes the average of the price changes (which is given in numerical values) only for the companies which code is equal to the code in the reference field.

So something like: =AVERAGE(IF((MOD(ROW(D2:D2353)-ROW(D2)+1,5))=0,IF(D2:D2353"",D2:D2353))) (currently counting every 5th line, since there is 4 lines between respectively PX/DPS/EPS for each company) –But with a constraint indicating only to include the value in the calculation if the codes are the same (e.g. "DI-EI" = "DI-EI").

So that the value, which is currently 20.96% (which now includes ALL price values), would only include those for the respective group (in this case, companies in the DE-EI group).

View 9 Replies View Related

Excel 2003 :: Dynamic Named Range Of Non-contiguous Cells Suitable For Chart Series Reference

Nov 11, 2012

I am running Excel 2003 on a Win7 system.

Here is my situation:

Each of my data sets spans roughly 75 columns by 250 rows at present, but this could expand. The first 7 rows contain metadata. Columns 2-25 or so contain the raw data, from which everything to the right is calculated. The data sets have most columns in common, but not necessarily all.

In order to tease out the most meaningful information from my data, I frequently sort all or part of it based on varying criteria. When I find a useful sorting criterion, I create a new column with a header that describes the criterion and populate it with a formula that returns a 1 if the condition of interest is met for that row, or a 0 if it is not. For example, if I am doing this in column AA, I might enter

=--(AND($AX8>$AA$4,$Y8>0))

and copy it down to the end of the data. The resulting vector of 1s and 0s quickly re-identify data that meets that criterion even after subsequent resorting. It also makes locating data that meets multiple sorting criteria extremely simple. Essentially, I create a truth table.

Cell $AA$4 in the above example contains a "comparator" value I might wish to change at some point, which would change the subset of data the condition selects for.

Here's the first hard part:

For each data set, I need the ability to generate meaningful plots that includes separate series based on the criteria I have described. However, I also need to retain the ability to resort the data or change the comparator value without disrupting these plots. In other words, the plots must NOT change when the order of the data is changed, but MUST change to display the appropriate data when the comparator changes.

Here's the 2nd hard part:

Once I have this working for one data set, I need to be able to port it to other data sets (which are contained in other workbooks), so that I can compare equivalent plots from each. I also need to minimize the number of manual steps involved in doing so, to avoid human errors and excessive time consumption.

The only other possible complication I can think of at the moment is that, to this point, I have been inserting blank rows to isolate subsets that I do not wish to perform further sorting on from each other.

Right now I am angling toward VBA code that loops through the entire data set to generate base dynamic ranges using the column header row (row 1) as the names, and the entire column of data for the rangeloops through the truth table columns to generate "branch" row ranges for each of the sorting conditions,loops through the entire data set one more time to create "branch" ranges for each of the base ranges.

I could generate some code to accomplish a one-off solution for a given configuration of a single data set (provided there is not a list length limit in a chart series that I'd be violating)...but without a dynamic named range, I don't know how to get to something that would update appropriately. So in essence, I am still stuck at the dynamic range part of this.

View 1 Replies View Related

Excel 2003 :: Averaging Cells In Multiple Sheets And Not Including Null Or Zero Value?

Jun 24, 2012

I need to calculate the average spend on a day of the week over the month, so all Monday's or all Tuesday's, etc. One sheet is one week so I need to average b16 on 6 sheets as an example.

I used =AVERAGE('WEEK1:WEEK6'!B18) to calculate average over the six Monday's. The issue is, as in other posts, how do I ignore the cells that have a zero or null value.

I've tried adjusting this which was in 1 post
=AVERAGE(IF($C$2:$CA$2=C62,IF($C$25:$CA$25"",$C$25:$CA$25
with this
=AVERAGE(IF(1+1=2,IF('WEEK1:WEEK6 '!B180,'WEEK1:WEEK6 '!B18))) which returns #REF!

this from another post
=SUM('WEEK1:WEEK7 '!B18)/COUNTIF('WEEK1:WEEK7 '!B18,"0") which returns #VALUE!

and this
=AVERAGE(IF('WEEK1:WEEK7 '!B180,'WEEK1:WEEK7 '!B18)) which returns #NAME?

The cells on each sheet are sum formulas for other cells on the sheet not just numbers on their own.

Using windows 7, excel 2003

View 3 Replies View Related

Creating Named Range Taking Avg To Date Of Dynamic Range

Jul 15, 2014

I have a column of data that keeps getting new information in it. what i need is a named range that i can use for a chart, first point in the named range will be the first value in the column, second point will be avg. of point 1 and 2, then 3rd point will be avg. of 1,2,3 etc.

View 1 Replies View Related

Dynamic Range For Pivot Table :: Error : Range Is Invalid

Oct 28, 2009

I am trying to get to grips with the dynamic ranges for pivot tables. I have named a range data and in the refers to section put:

=OFFSET(Sheet2!A1,0,0,COUNTA(Sheet2!A:A),COUNTA(Sheet2!1:1))

I was hoping that then when i go to data > Pivot table and it asks for the range i could put =Data but it tells me that the range is invalid. I have attached a copy at the bottom.

View 3 Replies View Related

Convert Dynamic Range To Static Named Range

Sep 13, 2007

My searches have not produced anything that I could apply to this situation.

I'm trying to write VBA that would:

1. Search a Workbook for Dynamic Ranges.

2. When a Dynamic Range is found the code would:

A. Determine the current coordinates for the range.
B. Change the "Refers To" value From "=OFFSET...." To "=Worksheet_Name $Column$Row:$Column$Row"

3. Save Changes.

4. Close File.

My apologies but I have very little experience in writing VBA. I understand about variables, arguments, and IF/THEN but just enough to use functions within Excel.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved