i have a table in exel
column 1 = bolt sizes in imperial values
column 2 = bolt sizes in metric values
now a called the column 1 ''bolt_size'' and created a drop menu where you can choose between all the different possible sizes (in imperial) but as for the rest of the sheet i need the metric values.
what i have been tryinh to do is once the choice in selected in the drop menu, the second value (the metric one) appears in a chosen cell where the rest of the sheet will call that value for further calcuations.
I have sucessfully made that cell display 1 - 10 (when choosing from the drop menu) instead of the actual values associated with the bolts.
Please help guide me in the right direction
If this is a Form Control/ Combobox, and you have specified its Cell link, then it will display the index number of the selected item, rather than the actual value. In a cell enter the following formula that uses the linked-cell's value to retrieve the text from the input range:
=INDEX(C2:C4,D6)
C2:C4 is the Input range and D6 is the Cell link.
If you are not using a Form Control then you'll need to clarify your question.
Related
I have two columns (Increment Rating & Promotion) where a user has to provide her input.
The "increment rating" input is restricted from Min (0.5) to Max (4.5) and the "Promotion" input is restricted to "Yes" or "No".
I know that for, Increment Rating I can apply the decimal validation criterion between Min & Max values, and for Promotion, I can apply the "list" criterion.
However, IF the user has entered the max value (i.e. 4.5) in the first column (i.e. Increment Rating), then Promotion must not be "Yes". It has to be either No or Blank (And I also need to show an error message saying that "This is not allowed"). On the other hand, IF the user is filling the second column (i.e. Promotion) before the first column and selects "Yes" as input then Increment Rating can not be more than Max-1 (i.e. 4.5-1=3.5) and need to show an error message here as well.
Is it possible with data validation custom formula? Or someone can help with #VBA.
Thanks.
You can create a table featuring the allowed data values for each input row and then refer to that table with relative references (i.e. no row fixing with $).
Here below is an example of such a table with formulas that adjust the allowed data values conditional on the input already provided. Note that the rows in the 'Source' section of the data validation window are not fixed.
Such that, when selecting the drop down window of those cells that have a list, you can see how the list is conditional on the table on the right.
If the input is done one cell after another (and not through copy and paste over both columns and once) an error message should not be needed since both columns have data validation restrictions conditional on one another.
You do not have to re-do the data validation for every row but simply select all input rows of one column and use relative reference instead of absolute reference in the 'Source' field of the data validation window.
I'm trying to design an order form for uniform orders that allows the user to select an approved item of uniform from a drop down list, which in turn then allows them to choose the size of the garment in another drop down list.
However as the garments have different size ranges I would like this variable list to omit any blanks. =IF(Sheet2!$B$3=$E$1,E2,IF(Sheet2!$B$3=$F$1,F2,IF(Sheet2!$B$3=$G$1,G2,IF(Sheet2!$B$3=$H$1,H2,IF(Sheet2!$B$3=$I$1,I2,IF(Sheet2!$B$3=$J$1,J2,IF(Sheet2!$B$3=$K$1,K2,IF(Sheet2!$B$3=$L$1,L2,IF(Sheet2!$B$3=$M$1,M2,IF(Sheet2!$B$3=$N$1,N2,IF(Sheet2!$B$3=$O$1,O2,IF(Sheet2!$B$3=$P$1,P2,IF(Sheet2!$B$3=$Q$1,Q2,IF(Sheet2!$B$3=$D$1,D2,"ERROR"))))))))))))))
I have the above set to build the size list based on B3 in Sheet 2 being the cell used to select the garment type. Columns D-E being the different garments, and rows 2-14 being the sizes for each product. the same code is repeated 13 cells (the longest size range) with cells where the size isn't available set to show nothing. e.g.
=IF(Sheet2!$B$3=$E$1,E7,IF(Sheet2!$B$3=$F$1,F7,IF(Sheet2!$B$3=$G$1,"",IF(Sheet2!$B$3=$H$1,"",IF(Sheet2!$B$3=$I$1,"",IF(Sheet2!$B$3=$J$1,"",IF(Sheet2!$B$3=$K$1,"",IF(Sheet2!$B$3=$L$1,L7,IF(Sheet2!$B$3=$M$1,M7,IF(Sheet2!$B$3=$N$1,"",IF(Sheet2!$B$3=$O$1,O7,IF(Sheet2!$B$3=$P$1,P7,IF(Sheet2!$B$3=$Q$1,Q7,IF(Sheet2!$B$3=$D$1,D7,"ERROR"))))))))))))))
However even though the the cell displays blank, because the formula is still in the cell the "ignore blanks" checkbox doesn't filter them out.
Any ideas? Or have I just overcomplicated everything?
I have a sheet with a price list for many items, all of them have a column for category and another column for core product, secondary or third. I then have description, price etc.
I have built an Invoice configurator that when the user selects a category it comes up with an offset formula for product (description) and a bloom up formula then brings up the item code, price etc.
I have an issue where I am trying to get the spreadsheet to allow me to have the following.
1. Dropdown for product type.
2. Dependent Dropdown for category
3. Dependent Dropdown for product type
4. Then the offset formula to look at all 3 Dropdown options and only provide me with those products.
Does anyone have any ideas?
Thank you in advance
You can create dependant dropdown menus with named ranges, data validation and INDIRECT formula. Then use FILTER formula to extract the products corresponding to the 3 selected options. I've made a tiny example :
With blue background, the dropodown menus (2 dependants). On the right, the named ranges. On top, the data. With green background, the output (1 result only since my sample DATA is very small).
EDIT : You want a dropdown menu to select the results (after the user has done his 3 choices). You can use TEXTJOIN to build a list from the results and then create another dropdown menu (dynamically resized). If you want something more "transparent" (no table of results to hide), it's possible to replace the FILTER formula with SUMPRODUCT and MATCH (the TEXTJOIN column will be placed in the original table and might cause slowdowns if the number of items is too big).
Sheet
I have one sheet containing the table name customer_id and Project_id.For each customer id various projects are displayed.when i try to create data validation by selecting all those it is not coming.for ex.
Customer_id Project_id
1 1.1
1 1.2
2 2.2
2 2.3
and like that.please tell me some solution.
This really depends on what you want exactly, but since your question is not that elaborate, I guess you mean this?
You can create a data validator from data in your worksheet in the following way:
Select the sheet you want the validator to be on
In the ribbon, click the data tab, and then Data validation
Select 'Allow List'
in the Source bar, select the cells with the allowed values
Another way, is to create a data validator using a vba or vb.net macro. In your macro say:
Dim range as Excel.Range = listSheet.Range("A1")
range.Validation.Add(Excel.xlDVType.xlValidateList, Excel.xlDVAlertStyle.xlValidAlertInformation, Excel.xlFormatConditionOperator.xlEqual, "Option1; Option2")
I guess what you want are two dropdown lists, the second depending on the value selected in the first one? (please elaborate your questions some more). To do that, I suppose there are other ways but this is what I usually do:
Take into account that I always use names to refer to ranges instead of references, to improve readness. If you have doubts to do it, read Use names in Excel formuas
Create a table or range somewhere in your book with one column with the master values.
I have named the range with the values master_list
Create a table or range somewhere in your book with two columns. The first column contains the master/look-up value and the second the dependent values.
I have named the list of look-up values (this is, the values in the first column) as dependent_list
I have named heading to the cell above the dependent_list (for example, if the dependency table starts in A2, the heading is A1
Order the lists
The master_list is ordered as you wish values appear in the dropdown list.
The dependent_list must be ordered by the values in the first column (master values). It doesn't matter if the order is the same in the master_list and the dependent_list, but identical values in the master column of the dependent_list must be together.
The order in the second column of the dependent_list will determine the order in the dependent dropdown list.
Optionally you can define a message to display in the dependent_list when there is no master value selected. I have named it msg_error.
Click on the cell where you want the master dropdown, ant go to the Data Validation menu, where you select:
Allow: List
Source: Add the formula =INDIRECT("master_list")
I have named the cell where the master dropdown list as key_value
Click on the cell where you want the dependent dropdown, and then go to the Data Validation menu, where you select:
Allow: List
Source: Add the formula =IF(key_value="";msg_error;OFFSET(heading;MATCH(key_value;dependent_list;0);1;COUNTIF(dependent_list;key_value);1))
Note that Excel functions are language dependent of the language and I have translated them to English, so maybe there are mistakes.
Ive got a spreadsheet which has 3 columns. These are name, age, value
I want to create an incell dropdown list based on unique values in the "name" column. There could be two cells in the "name" column with "John" in them for example. i.e. duplicates
When "John" is selected in a dropdown I want to create another dynamically created dropdown that shows only the age's for the entries. For example, if there were two rows with "John" in the name column then the other dropdown should show the age values for each of these only. Based on the two selections id like to show whatever's in the value column.
Do you think i need to use macros to achieve this?
To complicate matters the amount of rows in the list may change over time and therefore the blank names will need to be removed. The 'ignore blanks' when creating the incell dropdown does nothing and they are still shown in the list.
Any advice would be appreciated.
Based on your description I think you are creating list validated drop down cells. The lists can be subsets of an initial database. An example of such a database might look like:
With the validated drop downs adjacent like:
This can be achieved in a few steps.
1) Create a subset of all of the unique names in a helper column, I will do this in J.
=IFERROR(IF(NOT(INDEX($A$2:$A$20,MATCH(0,INDEX(COUNTIF($J$1:J1,$A$2:$A$20),0,0),0))=""),INDEX($A$2:$A$20,MATCH(0,INDEX(COUNTIF($J$1:J1,$A$2:$A$20),0,0),0)),NA()),"")
The range I am testing for uniques only extends to A20 but you could take this as far as you like.
2) Since you are doing this with validation lists that a user must select, you should probably alphabetize them. I do this in the next column over K.
=IFERROR(INDEX(INDIRECT("J1:J"&SUMPRODUCT(--(LEN(J:J)>0))+1),MATCH(ROWS($J$2:J2),COUNTIF(INDIRECT("J1:J"&SUMPRODUCT(--(LEN(J:J)>0))+1),"<="&INDIRECT("J1:J"&SUMPRODUCT(--(LEN(J:J)>0))+1)),0)),"")
This formula is an array formula and must be entered with ctrl+shift+enter for the first cell and then you can fill down. In a near by cell let's keep track of the complete range occupied by meaningful names used to make our alphabetized list (no blanks). Enter the following:
="K2:K"&SUMPRODUCT(--(LEN(J:J)>0))+1
Note that this is assuming my uniques are in column J. If you put them elsewhere you will need to modify this.
3) At this point we can make our first validated drop down. I'm using excel 2016 so I select the cell where I want the drop down (in my case E2) and then go to Data -> Validation. Under this I choose Allow: List; and Source: I enter the following:
=INDIRECT($K$1)
As K1 is the cell where I am keeping track of the range of useful and alphabetized uniques. Example:
Now back on the main sheet I have a drop down in E2 featuring that list. Next let's build the subset of useful ages.
4) In a new helper range (for me 'M2:M10') enter the following:
=IFERROR(SUM(LARGE(IF(($A$2:$A$20=$E$2)*ROW($A$2:$A$20),$B$2:$B$20,""),COUNTIF($A$2:$A$20,"="&$E$2)-ROW()+ROW($M$2))),"")
This is another array formula and must be submitted with ctrl+shift+enter, but in contrast the other array formula you must enter this for the whole range at once, I just selected a small number of cells because I know I won't have more than a few ages. If you suspect you will have more make this range large.
In the same fashion as the names lets track the range of useful ages in a nearby cell (I chose N1).
="M2:M"&COUNTIF((M:M),">0")+1
5) Make the next validated drop down. Select a cell (I picked F2) and again Data->Validation, choose a list and now use the age source:
=INDIRECT($N$1)
6) Getting the value that corresponds to the individual with that age is easy now. In the next cell over from enter:
=SUM(IF((A2:A20=E2)*(B2:B20=F2),C2:C20))
There you have it. An example of what my completed sheet looks like is here:
One last thing to mention. When you do this and toggle to a new name, it will not reset the age drop down automatically. So to make this appear reset, you can use some clever conditional formatting. I formatted F2 & G2 with the following rule and set the font color to white:
So while the value in each of those cells doesn't reset when a drop down with higher precedence is changed it appears to blank out forcing the user to pick a new age from that drop down.
Good luck!