Lookup on another sheet in Excel? - excel

I have a very simple Excel book that I am trying to spiffy up. Here's what it looks like:
Sheet 1:
ID Name
1 Bob
2 Joe
3 Earl
Sheet 2:
Name ID Whatever
I would like when I type a name on sheet two for it to match it to a name in sheet 1 and fill in the id for that row in the field in sheet 2. So If I type "Joe" in sheet two it will fill in 2 in the id column.
My problem is slightly more complex than this, but I believe this is the crux of it for now.

You can use VLOOKUP to look up values that are to the right of the key. INDEX and MATCH can be used to look up values to the left of the key.
The formula in this case on Sheet2 would be
=INDEX(Sheet1!A:A,MATCH(A2,Sheet1!B:B,0))

Related

Finding the values that don't match from one sheet inside a few cells of another sheet

I have an excel document with two sheets sheet1 and sheet2. Sheet1:
ID number Name
123 John
321 Pete
Sheet2:
Book Comment Comment2 Comment3
Harry Potter My ID number is 123
TLOTR The book is ripped ID: 321
Dune Nice book ID is 999 None
I would like to search the column "ID number" from Sheet1 inside the text in the columns "Comment", "Comment2" and "Comment3" from Sheet2, and return the whole row from Sheet2 of the IDs that don't match.
So, in this case, the return would be:
Dune Nice book ID is 999 None
I have been trying the vlookup, I know how to search inside a text, and how to search inside multiple columns, but I don't know how to mix both processes
It looks like you have two problems.
Your ID or key to link the two spreadsheets together must match the data type. For example, one sheet you have ID number: with a list of only numbers. The other sheet you have text and numbers.
Try Xlookup instead.
Both columns you're using as the matching key has to be the same data type (letters or numbers)
First, use Text to columns (in tools, Data - text to columns) to separate your ID numbers from the rest of your text string in your sheet 2 columns that contain the Id numbers.
= Xlookup(CellwithfirstIDnumber,Columnfromsheet2tosearch, Column from sheet2tobring back, "no match")
Good luck

RE: VBA - (VLOOKUP) + (VALUE +1)

I am completely new to VBA and an amateur to Excel. I am currently trying to learn VBA and so decided to set myself an achievable goal for my own progression. This project is the creation of a tool for documenting and presenting feedback.
Sheet 1, Cell B2 will be my cell range that'll be used for the VLOOKUP to refer to, this is a unique identifier.
B2:B25 is information that's brought from a table in sheet 2 via a standard VLOOKUP formula and contains all relevant information on the person the unique ID is associated with.
I am trying to add a button in C6 which looks up the unique ID in sheet 2 and adds one to the value within a specific cell.
For example: Sheet 1:
Column A Column B Column C
Problem 1 Count Button to +1
(VLOOKUP used) (Macro Button)
Sheet 2: Table Ranges from A:W
A: Employee Number (Unique Identifier)
B: Name of employee
C: Training Status
D:W: Problems 1 - 20 (With count to how many of these problems the employee has encountered / made).
I have so far discovered that:
Sheets("Sheet2").Range("D2") = Sheets("Sheet2").Range("D2").Value + 1
Works for adding +1 to the value declared in Sheet 2, D2.
What I'm struggling with is introducing a VLOOKUP function so that the button first finds the employee number declared in Sheet 1:B2 then +1 to the value.
Sheet1
Sheet 2

Linked columns in an Excel document

I'm trying to create an excel document with two sheets, the first one containing a list of fruit types, for example
ID Description
1 Apple
2 Orange
3 Pear
...
The second sheet would contain a reference to a row from the first sheet and some additional data.
For example
Fruit_ID Quantity Customer
1 12 Chris
3 7 Jenny
...
And when a user is adding a new row in the second sheet he would be presented with a drop down list of entries from the second sheet when setting the first column value.
The number of rows in the second sheet is dynamic ( user will be adding data into it).
How can I do this ?
Select the cells where you want to display dropdown.
Go to Data Tab > Data Validation
Enter the following criteria
Allow:List
Source: =OFFSET(Sheet1!$A$1,1,0,COUNT(Sheet1!$A$2:$A$1048576))
Change the sheet name accordingly and it will show drop-down based on the Sheet1, column 1.
Let me know if it works.

Excel look up value in array, return next value

I would like to look up a value in a range and return the value in the next row, but can't quite figure out how to do this. I especially would like to do this with formulas rather than VBA, and preferably with built-in formulas than custom (VBA) formulas, due to macro security issues.
I'm using Excel 2010. My workbook has two worksheets, "assessment" and "lookup". In lookup, I have lookup tables.
"lookup" looks something like:
Column A Column B Column C
1 Sales Engineering Manufacturing
2 Alice Bobbie Charlie
3 Dawn Edgar Frank
4 George Holly Isabel
In "assessment," I have some some drop downs from which users select one name from each column in "lookup." Based on some other criteria, I then rank these and create a new, sorted list (using INDEX() and MATCH()) that produce the selected name and corresponding column name a new sort order
Column A Column B
10 Engineering Edgar
11 Sales Alice
What I'd like is to return the name from the next row.
Column C
10 Holly
11 Dawn
But I'm having real trouble figuring out how to get there.
Assuming lookups is located at B2:D5 (change as required) and the result data is at F2:H3 (change as required) enter this formula in cell H2 then copy down.
=INDEX(
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),
1+MATCH($G2,
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),0))

Match name and copy row from sheet 1 to sheet 2 on corresponding column

I asked a very similar question to this one here, but I am trying to identify if a cell's numerical value is contained in a list of cells on a different sheet. If the cell from sheet A matches a cell in sheet B, mark a different column in B with a corresponding row in sheet A, otherwise leave it blank. An example is below:
Sheet A
Column A | Column B
-------------------
1 John
2 Sue
4 Bob
I would like the corresponding Sheet B to populate Column B like this:
Sheet B
Column A | Column B
-------------------
2 Sue
3
4 Bob
=IF(ISNUMBER(MATCH(I2, 'SALT, WOD, Champion Members'!A:A, 0)), "Y", "N")
I have been using the above answer to populate a different column in the same workbook, and I'm thinking I can maybe use this formula, but instead of "Y" or "N", somehow preserve the row.
You need to use VLOOKUP as already mentioned. But you will need to use another function to check for existence of the value, else you will get #N/A against ID 3
I used COUNTIF
=IF(COUNTIF($A$2:$A$4,E2)=0,"",VLOOKUP(E2,$A$2:$B$4,2,FALSE))
Use the VLOOKUP function:
=VLOOKUP(A1;Sheet1!A:B;2;FALSE)
Where A1 is the value you want to look up, Sheet1!A:B is the original sheet with the data.

Resources