How to create dropdown with multiple columns in excel - excel

!
Hi I am using Excel 2003. I need to add data validation to a column, it should display the two columns in the cell, when user selects, the 1st column value should be displayed in cell.
Ex:
Col1 Col2
IND India
CHI China
Column - display to select
Column
IND-India
CHI-China
after selecting CHI the China or CHI will be displayed in the cell.
Is there any possibility to do the process in Excel.
Thanks in advance for any help...

(1)
If you need a dropdown item to display a different title after being selected, you can have another cell serve as the display. For example:
Where B3 (the helper cell) can have a formula like =LEFT($C$3,3) or use INDEX/MATCH to look up keys (like in your 'For Validation' table).
And where C3 (the data validation list) has a custom format like ;;;"(Change)" or "(Select)" or even a symbol like "↓", and will never display the actual selected list item.
You can also do this with VBA by creating an activex combo box control.
(2)
If you need one dropdown list to depend on the selection made in another, you can use dynamic dependent data validation:
http://www.myonlinetraininghub.com/excel-factor-19-dynamic-dependent-data-validation

Go to Devloper tab - insert - active control- insert comobobox
draw comobox in your excel sheet
right click on combobox, open property
in listfill range, type range of your column
set coloumn count = 2
change the widht of colomn

You can use the dropdown menu for the first column and the VLOOKUP function for the second column.
VLOOKUP would look at the first column and based on what's there would fill the second with the data from somewhere else.
I've also found a YouTube tutorial on how to use the function. Here you go:
https://www.youtube.com/watch?v=-WAEzokHSJM

Related

Excel: Extract data from well beneath unique identifier

I have a spreadsheet full of data (simplified example below) that I would like to extract the number in the well underneath of "Gimme the number" and paste it into a new column on a separate sheet (i.e. if "Gimme the number" is in G6, I would like to retrieve the value for G7). I do not have access to Excel VBA and have not used macros in the past. I found some examples linked below, but, from what I understand, they would return "Gimme the number", or "Gimme" not 19, 20, and 21. I am not sure if a pivot table is appropriate, because I only want information from a single column. I will only have up to 11 values to extract at any given time, so I think a formula would do it. I am just having a hard time coming up with one that works. Any help would be greatly appreciated!
Search for a text string and return multiple adjacent values
Return multiple matches with wildcard vlookup
I am not sure I get the question well, but I try.
First add a column right of the column with "Gimme..." values. Name it e.g. "Next_value" in the first row. Put in the formula referencing previous column next row. If "Gimme..." is in the cell (for instance) E6, than your formula in the cell F6 is =E7. Copy that formula into the whole Next_value column.
Than select area of these two columns (Label, Next_value) and apply the filter from the Data toolbar. Use the small buttons with triangles at the top of the column Label to adjust the filter so only "Gimme..." rows are filtered.
Now, copy values of Next_value column where you like. If you want just the references, use Paste special function from the Home toolbar and click Paste link button.

Excel - Dynamic Dropdown List

Looking to make a dynamic dropdown list in a table. The photo link below should help visualize the problem.
What I am looking to do is create a dynamic dropdown list in one table using a column from the same table and two columns from a second table in another sheet.
The column with the dropdown should compare the column to the left of it to right column of the second table. The options in the dropdown should be the values in the left column of the second table if the cell to the left of the dropdown cell equals the cell to the right of the value cell in the second table.|
The photo below shows the table setups and the numbers next to the top left table show what options that should be in the dropdown.
Edit: I was looking to do this without using Visual Basic, but I would be open to it if it were the only option.
This is called dependent data validation. You need to set up range names. One for each reference, and an additional one to resolve the reference into a dropdown using Indirect. I set up these four range names and for the data validation I used List > =MyDropdown
a =Sheet1!$H$2:$H$5
b =Sheet1!$H$6:$H$8
cc =Sheet1!$H$9
MyDropdown =INDIRECT(Sheet1!$A2)
Note that the reference inside the INDIRECT() function is relative to the cell that was active when the reference is defined. Select cell in row 2, then create a new named range with that formula. If you select another cell, this will not work.
Note also that the named range cannot be called 'c', so I had to use another reference name.
As per above data setup put below formula to H6
=TRANSPOSE(UNIQUE(E6:E13))
Then put below formula to H7 cell and drag across right.
=FILTER($D$6:$D$13,$E$6:$E$13=H$6)
Above formulas will spill data automatically. Then in data validation for range A1:A10 put below formula
=H$6$#
# after H$6$ will take data dynamically output by Unique() formula till last data.
Then for range B2:B10 data validation formula will
=INDEX($H$7:$J$10,,MATCH($A1,$H$6#,0))
Dropdown result

Invisible table based on drop-down list value

There is a drop-down list with numbers that was made using Data-> Data validation. The goal is to make visible only the number of rows of the table that was chosen from drop-down list without using vba (to make it more easily to edit by ordinary users). The first column of the table contains numbers corresponding to the numbers from the drop-down list. The table also contains the columns with formulas. I choosed to use conditional formating with idea that all the cells of the table will be calculated and then hide those rows of the table that are under the row corresponding to the value of cell with drop-down list. In other words it needs to dynamically change the visible rows of the table or to dynamically form the table (but there is a columns with formulas and I don't know if you can do that without using vba). I've tried different ways but this problem seems difficult for me. Maybe instead of ordinary table you need to use smart-table or power pivot but I don't have experience of using it. Thank You for Your help!
Ok... let's asume you have the value in A1.
Now for the range of B2:G20.
Conditional formatting formula: =ROW()>$A$1
In the range of B2:G20 every cell will be formated with a row higher than the value in A1
If the format is something like ; ; ; it looks empty.
Using this example and having 11 in A1 -> B12:G20 will be hidden.
However: to set Row.Hdden = true you need to do it manually or use VBA :/

Excel Style Combo Box in Google Sheets

I have an issue regarding Google Sheets.
I have a spreadsheet in Google docs that i have copied from an excel spreadsheet that I created. What I need to figure out how to do is make a combo box that that when I select an option in the list it changes the value of another cell from a 1 to 2 or 3 or 4 etc.
I have this working in excel but cant seem to figure out how to do it in sheets.
My question is, does any one know of a way to do this? Is it even possible?
Maybe I am misunderstanding your question, but it seems to me that what you want can be achieved without any scripting (though it IS possible to script the whole thing, too):
For the "combo box" cell, add Data Validation selecting "List
from a range" or "List of items" under 'Criteria' as appropriate,
and "Reject input" option in 'On invalid data' section. This will
make the cell show a drop-down selection of items when you click on
the little arrow now displayed in the cell.
In the other cell (the one that needs to change value), enter a
formula that changes the cell value based on selected "combo box"
cell value. Depending on how big your list of items in the "combo
box" cell is, you can use either a simple IF() formula, or go for
a VLOOKUP() (if data validation items are coming from a range in a
spreadsheet), or a combination of them.
For example, based on the sheet as in the screenshot below, cells C1:C6 have Data Validation rule set to range F1:F6, and cells D1:D6 have the formula =IF(NOT(C1=""), VLOOKUP(C1, $F$1:$G$6, 2, FALSE), "DEFAULT VALUE") (obviously references to C1 changed to corresponding row of column D). When a value is selected from a drop-down in cells C1:C6, corresponding cell in column D changes its value to the one in column G matching selected value from column F. If no value is selected in cells C1:C6, corresponding cell in column D show "Default value" (which can be whatever you need).

Find and count each occurence of a name is column A then read a value from column B

I need a formula that is beyond me and my Excel skills, I need to insert the number of times a match is found in column A into column C and then insert the total number of days for that person in column D. Can anyone help?
In cell C2:
=COUNTIF(A$2:A$6,A2)
In cell D2:
=SUMIF(A$2:A$6,A2,B$2:B$6)
See also:
COUNTIF
SUMIF
Have you considered using a pivot table? It's a little bit overkill but greatly simplifies what you want to do. Assuming your using Excel 2007:
Select the range of data including column labels.
Go to Insert->[Tables]->PivotTable.
In the dialog box that appears, select Existing Worksheet, choose a cell a click OK.
At this point, the PivotTable pane appears with your field names in one box and four other labeled boxes below.
Drag Name to the Row Labels box.
Drag Name to the Values box.
Drag Days to the Values box.
You're done!

Resources