I have a list of items in column A and for some of the items, column B has value "Y". How do I only include the items of column A marked with "Y" in a data validation list?
I have tried this in the data validation formula but doesn't seem to work:
INDEX('Mysheet'!$A$8:$A$240,SUMPRODUCT(--('Mysheet'!$B$8:$B$240="Y")))
If you have Excel 2016+ with the FILTER function, you can
Enter this formula someplace on the worksheet: =INDEX(FILTER(A1:B10,B1:B10="y"),0,1)
Create a dynamic name definition. For example:
myList refers to: =OFFSET(Sheet1!$D$1,1,0,COUNTA(Sheet1!$D:$D)-1)
You can then use a Validation formula for the List:
=myList
If you don't have the FILTER function, you can use this formula:
=IFERROR(INDEX($A$1:$A$10,AGGREGATE(15,6,1/($B$1:$B$10="y")*ROW($B$1:$B$10),ROWS($1:1))),"")
and fill down until you get blanks, or at least as far as you might have y's in column B.
Then for the formula name (which has to be a bit different because of the blanks in the list):
refers to: =OFFSET(Sheet1!$F$1,1,0,SUM(--(LEN(Sheet1!$F:$F)>0))-1)
Related
I have a CSV Product Export from Shopify. I am creating a manual offline quote sheet for furniture items.
Column B = Product Title
Column A = Product Title's Handle (obtained using an Index formula)
PROBLEM:
Column D = Duplicates need to be converted into a list.
THEN using above formula add to a new cell for a Drop Down list (Add formula into Data Validation:Source.)
Note based on the image diagram: Ref 'I2' is located far top left where it says 'Aurora Chair 4 Leg'
NOTES,
And this formula is enetered into 'I3',
=XLOOKUP(I2,A2:A16,D2:D16)
.. but, this formula only returns 'D2', not D2:D5
I also unsuccessfully tried,
=indirect(I2,A2:A16,D2:D16)
=XLOOKUP((I2,A2:A16,0)RANGE D2:D16))
=index(I2,A2:D16)
=FILTER(A2:D16,D2:D16=I3)
{=SUM(COUNTIF(A2:A16,D2:D16))}
=COUNTIF(A2:A16,VLOOKUP(I3,D2:D16,1,0))
You can use this formula for a unique list of filtered values:
=UNIQUE(FILTER(D2:D16,A2:A16=I2))
You can't use this formula as a data validation source :-(
Therefore you have to put it somewhere (hidden) on the sheet, e.g. into cell K2.
And then refer to it as K2# in the data validation source.
Edit according to comment:
To show the values in a row instead of column you use:
=TRANSPOSE(UNIQUE(FILTER(D2:D16,A2:A16=I2)))
I need to populate a dropdown on sheet1 with data from sheet2 columnA. I can do this no problem. However, I only want the items from columnA to appear in the sheet1 dropdown if sheet2 columnB has an 'x'.
Screenshots/here refer (updates marked *):
Demonstration
Only values 1-10 have corresponding 'x' in 'col B' (here, d:d), whereas 101-112 correspond to 'y'. Output as follows:
Assuming you have Office 365 compatible version of Excel,
Lookup for validation list (F3#)
=SORT(UNIQUE(FILTER(C3:C41,--ISNUMBER(SEARCH("x",D3:D41)))))
(easily customisable for different range cols A, B - sheet_2)
Validation list
Reference lookup range directly (*updated thanks to note by #Harun24HR)
=F3#
Extras
If interested, a unique list of omitted values (cols A & B, sheet_2) can be determined in a similar yet dependent fashion (cf. first equation):
=SORT(UNIQUE(FILTER(C3:C41,--NOT(ISNUMBER(MATCH(C3:C41,F3#,0))))))
You can just use INDIRECT in the data validation statement that refers to a cell with an IF statement.
For example, in the below picture, my dropdown is based on the formula =INDIRECT($G$9) and the value of G9 is determined by =IF(ISNUMBER(MATCH("x", H3:H7,0)), "G3:G7", "G8")
More generally, just use =IF(ISNUMBER(MATCH("x", test_range)), drop_down_range, empty_cell) and be sure to use quotes around the dropdown range.
Test 1:
Test 2:
Hello wonderful people.
I have a series of named ranges, A_Colours, B_Colours, etc.
These represent sections of a sorted column in a colour list, sorted by codes for the manufacturer that makes those colours. These are dynamic named ranges, constructed by COUNTA for how many colours have that mfr code. By my calculation, the list should be contiguous, since the column is sorted by code.
I know I can reference the ranges in Data Validation by simply setting =A_Colours as the list source (no quotes). This does work in this case.
However, I have a dropdown to control which A-M range I want to show in the child dropdown.
So, e.g. dropdown in A1 shows A, B, C, D as options.
Dropdown in B1 shows dropdown options relative to the chosen option in A1.
EXAMPLE:
I select A from the list in A1.
In cell B1, I want my dropdown to show all values from named range A_Colours.
I have tried all manner of ways to pass the text string A_Colours to the DV list source field, but all have failed. Either error in formula, or the range evaluates to an error, or it allows me to select only A_Colours from the dropdown.
Example 1:
A1 choose A
B1 DV box:
=INDIRECT("$A$1")&"_Colours"
This gives error "The list source must be a delimited list, or a reference to single row or column."
Could this be because the table list is sorted? I don't think so because the very first example above works.
Example 2: use helper cell in C1 to create text string "A_Colours", by formula:
=$A$1&"_Colours"
Then in DV box for cell B1:
=INDIRECT("$C$1")
Please help me achieve this!
Thank you.
[Edit] SOLUTION:
Create new sheet as directed below.
Create header for each manufacturer ("A" in cell A1).
Enter formula into A2 (as an array formula, Ctrl+Shift+Enter):
=INDEX(Colours, SMALL(IF((INDEX(Colours, , 1)=INDEX(MFR,MATCH(A$1,MFR[MFRName],0),2)), MATCH(ROW(Colours), ROW(Colours)), ""), ROWS($B$1:B1)), COLUMNS($A$1:$B1))
I adapted it a bit, but credit for this goes to https://www.get-digital-help.com/2009/09/28/extract-all-rows-from-a-range-that-meet-criteria-in-one-column-in-excel/
Apply the formula down to the last plus a few to allow for expansion.
Apply the formula across to your last header.
Now you have lists which are definitely contiguous and single-column and not dynamic, so meet the stringent criteria for data validation.
Create a named range for each list, using the exact name keeps it simple but I chose to add "Name" to the end, e.g. Mfr1Colours.
Reference them in the DV source list field (for cell B2 in our original sheet) like:
=INDIRECT($B$2&"Colours")
What this does:
Looks in the Colours table:
MFR Code Colour Code
Finds the first matching instance of the MFR Code in cell A1 of our original sheet ("A") from the Manufacturer table "MFR", which has columns:
MFRName Code
Pulls out the row by the MATCH(ROW(Colours,Row(Colours),"").
Checks which row and column you want by the ROWS and COLUMNS at the end.
If you have a spare, helper range, where you would make a simple codetable with 2 columns - Color_Reference, Color_Names and name it c_colors:
A A_Colour
B B_Colour
C C_Colour
You could use this in CV list configuration for dropdoon on cell B1:
=INDIRECT(VLOOKUP(A1;c_colors;2;FALSE))
Try to look at the examples here, it may help you as well: http://www.contextures.com/xlDataVal02.html
I have write below array formula:
=INDEX(Table1[Column2],SMALL(IF(Sheet1!G6=Table1[Column1],ROW(Table1[Column1])-ROW(Table1[[#Headers],[Column1]])),ROW($A:$A)))
According this picture1:
Note that selected range contains above array formula.
I need define that array formula returned values in the list form of data validation for Column2 of right table.
What I had tried:
I defined a Name, because responsively Sheet1!G6 reference part of above formula have change in Column2 cells for its appropriated Column1 cell. (in right table), according to below picture2:
Then set Column2 of right table's data validation, (picture3 below):
The problem is
But in result, validation list only contains first result of array formula! as picture4 below:
Question
How can define an array formula valued results set to a Name (Picture 2 above) and use in List Data Validation (picture 3 above) for a Column of table ? (Picture 4 above)
My concepts are:
There where a array form formula as shown above. (On the paper and
not in a worksheets range, yet)
This array formula is corresponding to a set -collection- of (potentially returned) results.
I want use above set in the Data-Validaton List for a special Table column.
Not using helper things (as Sheet, Column, Pivot-table and Etc...)
Using (1)- Name (Ctrl + F3), (2)- the array formula (for generating valid results collection), and (3)- Data-Validation List (to check is entered value in above special Table column is valid or not valid; and let entering only valid data in that special column))
I know you said you don't want to use a helper column or sheet. But saying:
A Table and an array formula can't coexist.
Data validation source can't be a complex formula of any kind, but you can use Indirect to a named range or address (but only if its a continuous region, not multiple areas) on the source formula if you want.
An array is never returned as a whole result in array formula, each cell used on as target destiny of the calculation is an item of the returned array.
So what I would do, return the array formula in a region let's Say A1, and a counter to the number of items in your array result that are valid using another cell B1. Use a cell C1 to determine the address of the list that you want to use. Then use =INDIRECT(C1) in the source of your validation.
You can hide other sheet so another use can't see it, and if you hide it by macro you can set it to very hidden and it's not possible to make it visible from the workbook directly. You might also create a named range to the C1 cell in my example so the end user can't see where this source on validation is from.
I'm using the INDIRECT function to create a dropdown list in a cell. The contents of the list will depend on what is chosen in the previous column (same row).
e.g. if in Column A "Cuisine" I have three options in the list (Italian, Chinese, British), I want Column B "Dish" to reflect what was chosen in col A.
So if I chose "Italian" the list in col B will be "Pizza, Lasagne, Macaroni"
I've defined names on a separate sheet and I can get this all working by using the function INDIRECT($A$1) in the data validation command for the cell and using choose from a List.
However when I move to the next row, I want the same functionality. Is there way to reference the active row - something like INDIRECT ($A$ActiveCell.Row)??
Assuming cells in column A has a list of "Cuisine Types", for each of this "Cuisine Types" there is also a Defined Name containing the corresponding options for each "Cuisine Type". With a formula in Column B you want to retrieve the corresponding options for each "Cuisine Types".
Try this formula in cell B1 then copy till last record:
=INDIRECT( A1 )