Dynamic Range Using Offset And CountIF
Dec 3, 2008
I have a data set that alters each week which means at the moment I have to update the ranges manually each time. I would like to use a dynamic range and think I need to use the Offset and CountIf functions. Both the start and end of the ranges are dynamic. The range is based on grouping the numbers in Column E (LocNo)
What I would like to do or think the way to achieve this is by:
First looking at Column E
Count how many cells are equal to criteria. (CountIf)
offset 5 columns left from the first cell that meets the criteria (Offset -5)
offset X rows down based on how many cells meet the criteria (Offset X)
I've include a spreadsheet spread sheet which 'should' help illustrate the problem showing the ranges I would like and how the data changes each week.
View 5 Replies
ADVERTISEMENT
Jul 23, 2014
I know how to create a dynamic named range so that no blanks appear in my data validation list but have only ever done this for a list in a column, i.e...
-----A-----
1--Apple
2--Orange
3--Pear
4--Bannana
5--
6--
A1:A6 would be named Fruit, then name manager, edit: =OFFSET($A$1,0,0,COUNT($A1:$A6),1)
The Data Validation list then shows Apple, Orange, Pear, Bannana. And if I add Peach into A5 later, that then appears in the list.
What I need though is to edit this as if the named range 'Fruit' covers cells A1:F1.
------A---------B-------C--------D-----------E-----------F
1--Apple---Orange---Pear---Bannana---
2--
View 7 Replies
View Related
Oct 15, 2009
When I make a dynamic named range, I typically do something like:
=offset($A$1,,,counta(A:A),counta(1:1))
I remember awhile ago I saw (within some of the comments on Jon Peltier's site, I believe) a way to make a dynamic named range without using offset. Does anyone know how to do it?
View 9 Replies
View Related
Jun 24, 2006
I want to use a dynamic range in order to use this formula below in column A as long as there is something entered in column H = SUMIF($N:$N,A5,$I:$I). any ideas on syntax and will this be using the offset function within excel. I know I have posted a couple times about getting this formula to replicate itself down certain columns as long as someone enters text in another. I looked into the offset reply information somone posted but it seemed a little over my head.
View 4 Replies
View Related
Feb 15, 2013
I have column A fill with dates and column B with customer code. I'm looking to count the number of time the customer code (column B) is repeating but ONLY in previous year. Meaning that the count range must be adapt for each customer code. Will a countifs is able to work with this request?
View 6 Replies
View Related
Aug 26, 2012
I have three columns of data in columns A,B,C - there are formulas in these columns that either produce a numeric value or return blank.
I have created Dynamic Named Ranges for each of them and have entered the following formula:
=OFFSET(Working!$A$1,1,0,MATCH(1E+305,Working!$A:$A,1))
My issue is that this formula is looking one row past the last numeric entry in the column (a blank) which is leaving a blank space when I graph this data.
View 3 Replies
View Related
Jul 19, 2014
I have a worksheet where the number of rows will change on a weekly basis and I would like to print the sheet out without having to change the print range every week.
I have tried to use the OFFSET function in the print range in print setup but once this has been entered and printed, it changes to the actual print range the OFFSET returns.
View 1 Replies
View Related
Nov 6, 2013
I am using the CountIf function (in column B) to count the number of events called "EVENT1" from columns C (Time) and D (Events), but the range needs to include all cells which, at the current B row, have the same value as in row A. I want to use a dynamic range so that I can account for the repeats.
Column A
Column B
Column C
Column D
Time
Count
Time
Events
1
=Countif(,"EVENT1")
1
event0
[Code] .....
View 6 Replies
View Related
Apr 12, 2012
I'm working in Excel 2010. I'm trying to create a dynamic range, using the OFFSET function. I've got it working beautifully but as soon as I save it and close the Name Manager the range stops working. When I go back into Name Manager I find all the cell references have changed (from C1:C600 to C1048572:C595 - or some other strange range).
P.S. What it's doing isn't so important as when the cell references are right it works. But just for full info: It's an OFFSET function, starting at A1. It will look at a list of companies and use a Match function to find out how many rows to offset (based on where the first instance of a particular company. And it uses the COUNTIF to make the range the same number of rows as there are entries for that company.
Here is my broken function:
=OFFSET('Map Point'!A1048572,MATCH("Company Name",'Sheet Name'!C1048572:C595)-COUNTIF('Sheet Name'!C1048572:C595,"Company Name"),0,COUNTIF('Sheet Name'!C1048572:C595,"Company Name"))
View 3 Replies
View Related
Oct 1, 2012
I have a from that work great in PC but if opened in a MAC, some of the functions will not work.
For example, There is one cell with Data validation that based on the value selected in another data validation cell, it should only display all possible options pertaining to value chosen. These are the values: a user select a customer based on customer name. The Data validation will the put the customer number in cell AF3. In another call with Data Validation I have this formula:
"=OFFSET(SHIPTO,MATCH(AF3,SHIPTOColumn,0)-1,2,COUNTIF(SHIPTOColumn,AF3),1)"
SHIPTO is the Name range for the tabs called SHIPTO with "Shipto!$A$1"
SHIPTOColumn is the Name Range for "SHIPTO!$A:$A"
Column A is where the customer numbers are.
This work fine in a PC but not in the MAC using excel 2011
View 1 Replies
View Related
Mar 26, 2014
I have a spreadsheet which is generated by someone else. I am not allowed to edit or sort this data It is in the format:
Column A Names (Example Simon is in cell A11)
Column B emails (1 row down so a number would be in cell B12)
Column C Phone calls etc. (cell C12)
The data is generated automatically so one day Simon could be at the top and the next day Daniel etc.
I need to copy each set of data so I can produce a graph on a team report.
I would normally use OFFSET but as the NAME column could be in any order, the results appear for a different NAME
The data I need is always OFFSET by the same number of columns and rows so the data for Simon would be OFFSET by 1 row and 1 and 2 columns. The data always occupies the same cells in the sheet namely A11:F46.
View 9 Replies
View Related
Jan 1, 2010
why this isn't working?
=SUM(OFFSET(A4,0,3,1,(LOOKUP(9.99999999999999E+307,4:4))))
View 9 Replies
View Related
Sep 29, 2011
I have a table in cells A1:B11. I have two drop down menus in cells G3 and H3. When I select red in G3 I need Bob, Sam and Sarah appear in the drop down menu in cell H3. Instead, with my current formula, only Sarah appears in the drop down in cell H3. When I select green in G3 I need Tommy, Bob, Sandy, Carl and Phil appear in the drop down menu in Cell H3. Instead with my current formula only Phil appears in the drop down in cell H3.
I linked cell H3 to the defined name Names which equals
OFFSET(INDEX(Sheet4!$B:$B, MATCH(Sheet4!$G$3, Sheet4!$A:$A,0),0),COUNTIF(Sheet4!$A:$A, Sheet4!$G$3)-1,0).
What should I add to this formula to make it work correctly?
ABCDEFGH
1RedBobRed2RedSamGreen3RedSarahBlueRedSarah4GreenTommy5GreenBob
6GreenSandy7GreenCarl8GreenPhil9BlueCarl10BlueSam11BluePhil
View 9 Replies
View Related
Jul 1, 2007
Does COUNTIFS not work with named ranges/dynamic ranges? Everytime I try, I get a #VALUE! error. These are my 2 dynamic ranges:
ResultsM=OFFSET([results_list.xls]Results!$M$4,0,0,COUNTA([results_list.xls]Results!$M:$M),1)
ResultsQ=OFFSET([results_list.xls]Results!$Q$4,0,0,COUNTA([results_list.xls]Results!$Q:$Q),1)
The formula is simply:
=COUNTIFS(ResultsQ,"GENDER",ResultsM,"MALE"
However, this does NOT work. it returns the #VALUE! error. However, odly enough, when I use column references, it works:
=COUNTIFS([results_list.xls]Results!Q:Q, "GENDER", [results_list.xls]Results!M:M, "MALE")
This makes me think that COUNTIFS just don't work with named references..
View 8 Replies
View Related
May 27, 2013
i'm running out an option, i must use offset or index function but there are problem found: 1.Offset function cannot use a dynamic height or number of columns and the result are #NAME?, here is the code
VB:
Private Sub CommandButton1_Click()Dim k As Variant
Dim b As Variant
Range(Me.RefEdit1).Name = "item"
[Code]......
View 3 Replies
View Related
May 28, 2014
I am trying to create a dynamic Excel line chart.
All is well, except for my x-axis (which is a text axis). It currently looks like this: Dynamic axis.jpg
I am using the Offset formula. The formula for my x-axis is =OFFSET(Worksheet1!$D$4,0,-3,COUNT(Worksheet1!$D$4:$D$36)). This is to show the axis if cells in Column D are filled up appropriately.
However, in the cells containing the axis name itself, this formula is used =IF(D9=0,NA(),'Worksheet2'!A6). I've tried removing the formula from these cell, but that didn't solve the problem.
View 5 Replies
View Related
May 18, 2007
i have 2 worksheets. one with portfolio stock data, and a second that i would like to use for dynamic charting. the chart worksheet has a drop down menu that chages a refernce cell to a number corresponding to the collumn in the portfolio worksheet for the chosen ticker
i would like to make a dynamic chart that updates the data ranges based on something like this: ....
View 9 Replies
View Related
Nov 22, 2006
The following formula produces the desired result:
=COUNTIF(INDIRECT(TEXT(A8,"mmm")&"!B2:Z100"),"SK")
but replacing the range of cells with a dynamic named range returns #REF!:
=COUNTIF(INDIRECT(TEXT(A8,"mmm")&"!Data"),"SK")
where A8 is the date 01/01/07. I'm trying to count items within the range Jan!Data.
I'm not sure if I'm trying to do the impossible, or if I'm missing something.
View 9 Replies
View Related
Jan 7, 2014
I am in the process of setting up some graphs. The graphs will show the last 6 months of data so they move as each month is goes. I saw a slick way of doing this using the count function but this did not quite fulfill my needs. What I was looking for is to be able to input the start month in a cell. The cell would be part of the function within the formula. I created a simplified version of the spreadsheet below.
Spreadsheet.jpg
Then I created my names using the ctrl-F3
Names.jpg
I then created the graph I wanted and wanted to use the formula =SERIES(Sheet1!$B$3,!chtCat,!chtIssuesReported,1). This kept getting an error indicated nothing really. It basically says there is something wrong with my Series function. I have a working version of a similiar worksheet I have been basing my entries on. They look almost identical but mine is failing. I also created a new file and tried this and it still fails. I can run the formula evaluator within Excel 2010 against the !chtCat and !chtIssuesReported names and they both return the correct value (which equals areas on the spreadsheet). I have also tried to enter the spreadsheet name and a tab in front of the names to get them to work and still get an error. Basicall I am trying to create the graph below (this grpah is using the hard coded locations)
Graph.jpg
View 2 Replies
View Related
Dec 25, 2008
I use the standard OFFSET-COUNT-MATCH method to create dynamic named ranges in my Excel projects. Needless to say, this method won't work on a spreadsheet with formulas extending beyond the current range. The count function counts the cells containing formulas, even though they may contain no data. Does anyone know how to construct a formula that will IGNORE the "formula only" cells??
View 3 Replies
View Related
Dec 11, 2012
I'm trying to create a dynamic COUNTIF function that references a previous cell.
For example, if I have 10 columns:
A B C D E F G H I J
a 1 b 2 c 3 a 1 b 3
I am trying to write a function that will let me reference A1:J1 and then if the cell contains an A, do a countif among the cell+1 for cells that have a value of "1". In this example, that function would return a count of 2. I think that I need some kind of combination of IF, INDIRECT, and COUNTIF, but I'm not sure how to string them all together--or maybe there's another way altogether.
View 5 Replies
View Related
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
May 16, 2009
I am having trouble with one line of this code that I can't figure out how to write correctly. I have set the range, but I need to offset by 10 rows up. My code fails at set rng.
View 6 Replies
View Related
Sep 29, 2009
I have an offset range ("TheCell") that does not seem be working how I would expect.
I don't know if its because the sheet I am working on was originaly German but I would be surprised if that was the case.
I Use sheet change to set the peramiters of the range and to test the value
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rowcell
Dim colcell
Dim typeit
colcell = ActiveCell.Column
rowcell = ActiveCell.Row
ActiveWorkbook.Names.Add Name:="iname", RefersToR1C1:="=" & "Tabelle2!R1C" & colcell
ActiveWorkbook.Names.Add Name:="Jname", RefersToR1C1:="=" & "Tabelle2!R" & rowcell & "C2"
typeit = Range("TheCell").Value
MsgBox typeit
End Sub
=OFFSET(Tabelle1!$B$4,MATCH(Jname,Tabelle1!$B$5:$B$57,0),MATCH(iname,Tabelle1!$B$4:$EX$4,0)-1)
but for some reason I am getting a runtime error 1004 worksheet failed.
I have used this technique before and its been fine so what mistake have I made :o)
View 9 Replies
View Related
Aug 24, 2006
I want to apply some logic to a range. However I want to offset the bottom of the range by 1 row.
Example: I have a range (B8:I19) already defined in my vba code. But I want to shade range (B8:I20).
MyRange = Range("B8:B19")
MyRange.Offset(1, 0).Interior.ColorIndex=3
This code also offsets the top of the range (row 9), which I don't want.
How can I only offest the bottom of the range?
View 5 Replies
View Related
Aug 29, 2008
I would like to work with a range of cells.
I have a headerCel (A2)and a footerCel (A20).
If I use the line
View 9 Replies
View Related
Dec 8, 2008
I am currently writing some VBA code to loop through and copy data from Excel file in sub folders into a master sheet of data. There are some 1200 Excel files (these are pre-2007 files), each containing a maximum of 600 lines of data. So far the code works until it gets to around 65000 rows (the old Excel limit). I am using and writing the code in a Macro-Enabled Excel 2007 file.
I am using a Range.Offset call, which is where the error is occurring, to copy in a name basically. What happened right before this was a Range.Copy operation from the old Excel file to a Range.PastSpecial in the new one. This worked fine, and actually went a few hundred rows past the pre-Excel 2007 limit. But when the single cell operation Range.Offset().Value is called next, it crashes with a Application or User-Defined error. The code works some 100+ times through the loop with no problem, and the file that it was working on is no different then the other files.
View 9 Replies
View Related
Jan 28, 2009
I am trying to create a macro that goes down Column A of my sheet and looks for a string, "Number". When it finds it, it resize (0, 14) and cuts. Then it pastes the array at an offset of (-1, 10) This is what I got so far:
View 4 Replies
View Related
Mar 10, 2009
I'm trying to copy a range, specified by an offset, then PasteSpecial that range to yet another location specified by an offset.
This is the code I have so far, which does not attempt to find the range to copy via an offset.
View 5 Replies
View Related
Oct 11, 2011
How do I activate four cells to the right of A5 using the offset function. I will need this to operate indivitually for each row so I cant use Range("B5:E5").Select. All I want to do is to merge the four cells to the right of column A
View 6 Replies
View Related