Dynamic range names created at each change in column value - excel

I have a dataset and want to Loop through Column A and create a new range name for each change in the account number. The data set size is of variable length each day.
ie
Account1393 = A1:C5
Account1726 = A6:C6
Account2098 = A7:C7
Account2246 = A8:C9
I tried using an Index/Match Solution to solve a problem but determined that a vlookup solution worked better. However I do not know how to automate the creation of dynamic ranges based on account number in a constantly varying set of data.
So what I am looking for is a solution that will create the account range names at each change in column A

Related

Dynamic named range including rows and columns

Little help needed here with excel dynamic named ranges.
I know how to make a dynamic named range that adjusts row height depending on the size of the range (no. rows with data in):
=OFFSET(Helper!$DJ$3,0,0,SUM(--(Helper!$DJ$3:$DJ$30<>"")))
However I find myself working with a large(ish) range of data across multiple columns - about 100 - and I REALLY want to avoid making 100 named ranges.
It must be possible to create a single named range that references the whole data set (DJ3:HE30) and the formula dynamically chooses which column to look at and (as before) chooses how many rows to return in that specific column.
The closest I've got is this:
=OFFSET(Helper!$DJ$3,0,0,SUM(--(Helper!$DJ$3:$DJ$30<>"")),SUM(--(Helper!$DJ$3:$HE$3<>"")))
But this just goes to the last column with data in (which makes sense really as it's doing the same thing with columns as it is with rows).
I'm assuming I need to tweak the starting point of the offset ref and somehow pass that column to the rest of the formula.
These named ranges are going to be used for drop-downs so the first drop-down will be the criteria that needs to be passed on to the second drop-down (that will utilize this new funky named range).
For example - if my first drop-down uses criteria 1,2,3 etc - my second drop-down would need to display results like this:
Option 1 = A,B,C
Option 2 = D,E,F
Option 3 = G,H,I
So the lists containing the letters in this example are all in individual columns, so the dynamic range needs to identify which column to use to pull the right list.
Also, with the number of columns I think I need to make this an INDEX rather than an OFFSET.
Can anyone point me in the right direction?
Thanks in advance, much appreciated!
It looks like I have managed to solve this one myself.
What I have done is create 2 named ranges as helper cells - Range_Start and Range_End. These ranges are single cells that contain an ADDRESS ref using MATCH to pick out the start and end of the column I need.
I then pass these named ranges to the formula I showed in my question but using INDIRECT to convert the cells to addresses:
=INDIRECT(Range_Start):INDEX(INDIRECT(Range_Start):INDIRECT(Range_End),COUNTA(INDIRECT(Range_Start):INDIRECT(Range_End)))
Works like a dream :-)

Excel Formula for Defining Range for COUNTIF value in Dynamic Data

The scenario...
The Excel file is generated from dynamically loaded data into an Excel table.
One column has a value that is associated with a group of records.
The group of records can range from a single record to dozens.
A second column has a variety of meta-data values.
Next column contains a formula to identify if a given meta-data value exists in the rows of the group. EXAMPLE: [NON-HUMANS] =IF(COUNTIF(RANGE,"<>HUMAN")>0,"YES","NO")
NOTE - The group value correlates to a UUID of which there are hundreds, for the sake of simplifying the sample data, I have used ALPHA, BRAVO, CHARLIE, ETC.
The issue - as the number of group records varies, I need to define the range in the formula based on the GROUP column value.
SAMPLE DATA SET
GROUP,MEMBERS,SPECIES
ALPHA,Scooby,DOG
ALPHA,Shaggy,HUMAN
ALPHA,Velma,HUMAN
ALPHA,Daphne,HUMAN
ALPHA,Fred,HUMAN
BETA,Alvin,CHIPMUNK
BETA,Simon,CHIPMUNK
BETA,Theodore,CHIPMUNK
CHARLIE,Superman,HUMAN
CHARLIE,Batman,HUMAN
CHARLIE,Robin,HUMAN
CHARLIE,Wonder Woman,HUMAN
CHARLIE,Aquaman,HUMAN
CHARLIE,Wonder Dog,DOG
DELTA,Spider-Man,HUMAN
DELTA,Ice-Man,HUMAN
DELTA,Firestar,HUMAN
If you have Excel O365 then you can utilize XMATCH(). Try-
=IF(A2<>A1,SUM(--((INDEX($C$2:$C$18,XMATCH(A2,$A$2:$A$18,0,1)):INDEX($C$2:$C$18,XMATCH(A2,$A$2:$A$18,0,-1)))<>"HUMAN")),"")

Excel using a string as a cell reference

I am trying to create a dynamic graph that checks which financial year it is and then only graph the data for that range of months.
I have a 'SUMMARY DATA' sheet that has rows with the date range 1/7/18 || 31/7/18 and so on for every month. I am trying to create a dynamic range that takes these values and then have the graph use those cell references.
Currently I am using a fancy concatenate function that gives me 'SUMMARY DATA'!$H$25:$H$36 (In cell DASHBOARD!$AJ$24) which is the range that I want to reference. I can't seem to get this working with a graph though. If I place =DASHBOARD!$AJ$24 as the series values, the graph doesn't update with the correct values (just 0 for every column). If I try using =INDIRECT(DASHBOARD!$AJ$24), it gives me a "That function isn't valid" error.
Not sure how to progress
First, create a named range (Formulas, Defined Names, Name Manager) called cdata with a Refers to: of,
=indirect(DASHBOARD!$AJ$24)
Now use =Dashboard!cdata as the chart data source.
Be advised that these series data references are resolved; they do not stay dynamic. i.e. changing the reference in DASHBOARD!$AJ$24 does not automatically alter the chart data.

Excel 2007 - Named Ranges

I have a worksheet where data is updated from an external source. The page contains data from today going out 20 days. I have a named range for each column i.e. Today ($D$4:$D$50), Tomorrow ($E$4:$E$50), etc, etc. My issue is that sometime the data from the external source does not contain data so nothing is populated in the columns. However, when there is data being returned again the name ranges are automatically changing i.e , Today changes to ($F$4:$F$50). No new columns are being inserted or deleted.
How can I specify / force the name ranges always to stay the same i.e. Today is always column E, I thought that was the point of the $.
Thanks.
you could try this formulae for your named range formula.
In Name Manager, edit your named range and pop a modified version of the formulea below into the refers to: field.
The modifications will be to the numbers within the address() function. The first value is the row number, the latter is the column number, so Column A = 1, Column B = 2 and so forth.
=INDIRECT(ADDRESS(1,13)&":"&ADDRESS(50,13))
It then uses the indirect function plus a concatentation of the 2 address functions to change formulae to a cell reference that the named range can use.
So the example above, means my named range will go from M1:M50.

Excel Data Validation List using formula with filtering

I have following workbook:
Worksheet Accounts:
Worksheet Posts:
I would like to know if it is possible to define Data Validation of type List to entire column B in sheet Posts using formula, so that Data Validation popup shows only Account Ids from Accounts sheet which Website column matches Website column of a selected row in Posts sheet and which have value Active in Status column?
In SQL-ish or LINQ-ish words:
SELECT Id FROM Accounts WHERE Website =
#SelectedPostRow.Website AND Status = Active
Marks on the second image shows which values should be shown in a drop-down.
Yes you can do this, but it requires some supporting setup.
First for each of your website options, you need to create a named range for the options that would be in the drop down you are seeking to create.
To do this, just highlight the list of cells and right click, the choose Name a Range
Then you need to create a lookup list for your website names to the named range possiblities
Then in your data validation source use a forumla like this:
=indirect(vlookup(a1,$i$8:$j$13,2,false))
then whala, the dropdown list changes based upon the website value.
Now if you are also needing to automate the named range bits, you could change them to encompass entire columns and then use a pivot table to pull in the data. Would just need
an independant pivot for each website option.
Each time you pulled in fresh data you would need to refresh the pivots, but it would function.
This problem need a bit of a preparation.
In the same sheet, or in another, copy your data (or add the relevant cells)
In column A you have a number that could be ranked.
I obtained it with (cell A2):
=IF(C2=$J$2,1,0)*IF(E2="Active",1,0)*ROW()
In column B rank the number and exclude the unwanted rows (B2):
=IF(A2=0,0,RANK(A2,A:A))
Then you can VLOOKUP in column H, using a enum in column G (manually entered). The formula for H1:
=IFERROR(VLOOKUP(G2,$B$2:$D$9,3,FALSE),"")
Now you could set your validation based on column H
PS: there could be small errors in the formulas as I have translated them from italian and I cannot test in english.

Resources