Hopefully this is an easy one. Basically I have a list of item numbers as well as a list of their descriptions in the adjacent column, (Call it "Item numbers" from A1 to A20 and "Item Description" from B1 to B20). So I have created a drop down for the Descriptions in column B and I want it to automatically fill in the correct Item Number in the adjacent cell in column A. So i have created a separate table with the corresponding Item Numbers and Descriptions next to each other. Yet, I can't seem to get a proper formula to reference the original A and B columns. My research said the Index formula could do it, but I'm not sure. Furthermore, I'm open to a more simpler way as well.
Thank you for any help
I thought you could do this with a VLOOKUP, but it can only be used to search in the first column (A). So you have to combine INDEX and MATCH:
=INDEX($A$1:$A$20, MATCH(E11, $B$1:$B$20, 0))
where E11 is the cell with the dropdown.
Related
I am building an excel sheet that returns the three highest values from a column in another sheet (sheet2, column B) along with their corresponding company (sheet2, column a). Ultimately, in sheet 1, I want to have a table that will display the company with those values.
This is what I am trying to achieve:
AWS ($280.9m), Google ($241.9m), Meta ($168.7m)
I was trying to use the large formula, but this does not help me with referencing the corresponding company so I’m unsure how to return both.
You can use LARGE to get your top-n, and then wrap with INDEX/MATCH and OFFSET to get the company name.
Cell E3 formula:
=LARGE($B$2:$B$7,ROW(E1))
Cell D3 formula, which returns the column to the left of the Large value:
=OFFSET(INDEX($B$2:$B$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0)),,-1)
or remove offset and use....
=INDEX($A$2:$A$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0))
Drag down your formulas as far as you would like.
The above solution is good but kinda oldschool. I would use =SORT() function instead:
=INDEX(SORT(A46:B56;2;-1);{1;2;3})
Translation to human language:
=INDEX(SORT(MyArray;ColumnToSortBy;Descending);{get first three rows}, [column])
*note: depending on your windows settings your Array row separator may differ. The easiest way to check your it is to select any range with more than one row, then get to formula bar and click F9 to see result preview.
where [column] is an optional argument, by default it takes 1st column.
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.
I have this excel file with two sheets. Sheet 1 is the page where all of the part numbers and descriptions are placed. Sheet 2 is a database set into two columns one with part numbers the other with the description.
I have been looking into vlookup within excel and in which case i have it working with the part numbers so when i enter the part number or choose from drop down it will auto populate the description for me. The issue I am having now is that when i enter the part number it doesn't auto populate the description column until i double click the cell with the formula and hit enter.
I also want to do a reverse lookup from the description side where it will auto populate the part number as well.
Here is my formula I used for the vslookup.
=VLOOKUP(A9,Database!$A$1:$B$250,2,FALSE)
I came up with this formula after researching how to do it but I had to change the A9 portion to each row number ie. row 9, row 10, etc..
If you want to do a reverse lookup then vlookup will not work as it only works left to right - unless you repeat the data in column A in column C...
However, the more elegant solution is with index() and match().
=INDEX(Database!$A$1:$A$250,MATCH(B9,Database!$B$1:$B$250,0))
Not tested, written based on the info you gave in your vlookup, match will find the position of the item looked for and then index collects the result at that position in column A.
The beauty of index/match is that the columns don't have to be next to each other AS LONG AS THEY ARE THE SAME LENGTH...
Try right clicking the numbers column > format cells > format as text (by choosing "text" under the categories box). Hopefully this will make the auto populate work.
This is probably a silly question but I have looked around for a while now and I'm not finding exactly what I need.
In sheet 2, I have a list of items down column A. Then I have text next to those items in column B. Text in B3 is only related to A3 etc.
I have a dropdown list of all column A item names on sheet1 and I'd like a cell somewhere on this sheet to display the corresponding info/text depending on whatever item I chose from the dropdown list.
For example, if I had small stories that would pop up depending on the title of the story - I'd select "Red Riding Hood" from the drop down list and then the short story would populate into a designated cell.
I feel like this should be pretty straight forward but I couldn't find the right formula. Thank you for your help.
This can be done with a lookup formula, for example Vlookup. On sheet1, select the story title in A1, then use this formula in B1 to show the text
=vlookup(A1,Sheet2!$A:$B,2,false)
The story will now show in the cell with the formula. You can copy the formula down and select different titles in A2, A3, etc.
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).