vlookup to find match and return another element in row - vlookup

i have two sheets. first column of both sheets has userids, but there is only some overlap of ids between the two sheets. i want to keep the userids in the first sheet, but in the second sheet, the second column has a point of data that i want. for those userids in the first sheet that are also in the second sheet, i want to get this data.
so, for say the first row's userid in the first sheet, how could i use vlookup to find that same userid in the second sheet (if it exists), get the value of the second column of that match, and bring it back to the second column of the first sheet?
thanks

Modify and put this formula into the first cell of the second column on the first worksheet. Then copy and paste it down the column:
=VLOOKUP(A1, Sheet2!A$1:B$100, 2, FALSE)
Let's look at the parameters for this function:
A1: This value, on this worksheet, is what we're searching for in the range given in the next parameter. When you copy and paste the entire formula down the column, it increments the row # with each row. In row 2, it will be modified to A2, and so on.
Sheet2!A$1:B$100 : This is the range that we are interested in, on the second worksheet. It is the top left to bottom right cell. The $ symbol tells Excel not to change the row #'s when you copy and paste the formula down the column. Modify B$100 to fit the range of data you are interested in... something like B$30 if you only have 30 rows of id's on the 2nd sheet.
2: This is the column you are interested in retrieving the value, relative to the above parameter. In this case, the 2 corresponds with column B.
False: This instructs Excel to find the exact match.

Related

Input text in one column (a) if the value in another column (b) is found in another column (c)

I have two lists of people - they will not be sorted in the same order. The second list is in a different sheet. If the person listed in column A shows up in Column A in the second sheet, I want column F to display "Y." If not, I want column F to display "N."
This formula: =ArrayFormula(vlookup(A2:A,Attendees!A2:A,1,0)) almost gets me there, but I can't figure out how to get it to return Y/N instead of the name of the Attendee or not.
Any ideas?
try:
=ARRAYFORMULA(IF(IFNA(VLOOKUP(A2:A, Attendees!A2:A, 1, 0))="", "No", "Yes"))

How to populate a VLOOKUP with a dynamic range in Google Sheets?

I have a file that needs to look up the team name (on a tab called "Parse") of an employee on a tab called "Roster". This can be done with a simple array Vlookup, however, the issue is that each week, we add a row to the Roster tab because employees sometimes move around.
I have already done the majority of legwork by using a MAX/FILTER/COLUMN, LEN formula to determine what the last column is in the Roster tab. I have also created a range that will provide me with the actual range needed for the VLookup. For example: If the last column in Roster is "G", I already have a formula that populates "'Roster'!A2:G", which is the range I would need for my Vlookup. If the last row in Roster is "P", then the formula shows "'Roster'!A2:P".
The formula that gives me the range, as I described in the examples, lives in cell F2 on the Parse tab.
So the hard part is done. All I need to know now is, when writing my Vlookup, how can I have the formula reference the actual contents of cell F2 in the Parse tab instead of thinking the lookup range is cell F2. Here's a visual:
Cell F2 in the Parse tab reads: 'Roster'!A2:G (because as of now, column G is the last column with data. this is correct).
My VLookup is VLOOKUP($A2,$F$2,7,FALSE). However, I want my Vlookup to say VLOOKUP($A2,'Roster'!A2:G,7,FALSE).
Is it possible to have the formula reference what is IN cell F2 instead of referencing just "F2"?
I hope this made sense. It's the end of my workday and I'm very tired.
try something like:
=VLOOKUP(A2, INDIRECT("Roster!A2:"&
SUBSTITUTE(ADDRESS(1, MAX(IF(Roster!1:1<>"", COLUMN(Roster!1:1), )), 4), 1, )),
MAX(IF(Roster!1:1<>"", COLUMN(Roster!1:1), )), 0)

M query - Edit the value of cell H2 in a table

Having imported an excel sheet into power query, I need to tidy it up by changing the value of a particular cell.
At the moment that cell has a null value, but there are other null values in the same column that I do not want to change. – So I cannot replace all of the null values in that column with another value.
I also cannot correct that particular cell in the source excel file (there are hundreds of them, which were created before I arrived).
I basically need some syntax for example that sets the value of cell H2 to “Jeep”, but not to change any other cells.
Very grateful for any insight.
One way would be:
In the Power Query Editor:
Add an index column starting from 1 (tab Add Column)
Add a Conditional column: If [Index] = 2 then Jeep else [H] (tab Add Column)
Delete Index column and [H] Column
Rename Custom column to [H].

Compare a value from two column and get matching value from another table Power BI

I am fairly new to powerbi and I need your help in one task on which I am stuck on.
Basically I have two tables and I need to compare the value from table one with a row of table 2 and return the output.
Table 1
I need to compare values in column a & b and get a match from table 2.
For example if row 1 has BY Green & BS HIGH then I need to check this value from matrix table below and return the output in column value as either 0 or 1.
Table 2
As you can see the Table 2 first row has value BY Green and BS low has a value '0'
Try this...
Index() returns a value from the matrix (in purple) based upon the intersections of the two match()'s. The first is the Vertical match in from the Table1:Col A; the second is the Horizontal match from table1:Col B. The value found at that intersection is returned.
... My apologies ... just saw this was a BI request... no worries...
First, Need fixup table2 as a lookup file:
First, click a cell in table 2 (don't edit), then Data menu >frm table/range, will bring up the Power Query window. Select columns B (not A) through Col F), then in the PQ Transform menu > Unpivot to create the new lookup table. this can either be saved as a new table or be used by reference.
Next, open and merge Table 1 PQ_Table 2 (Be sure to select BOTH Columns in BOTH Tables, in the same order). Then, expand the table tab following the merge expand the table tab. I only selected the value to return but you can return all the values to verify, then delete the unneeded columns.
Hope this helps...
Good Luck.

Searching for unmatched ntheames when comparing spreadsheets

In one spreadsheet I have 3 columns with a first and last name of a person combined. In the 2nd spreadsheet, I have column a = first name and column b = last name.
I want to know which names in spreadsheet one cannot be found in spreadsheet two. I also need to verify the data to make sure that the formula was accurate on finding the correct lookup.
Do I have to combine my columns in spreadsheet 2 to make the first and last name in the same column to make this work?
Which formula would you use for either scenario?
Use this:
=ISNA(MATCH($A1&" "&$B1,Sheet2!$A:$A,FALSE)))
Where (in order):
A1 is the first name column in Sheet1
B1 is the last name column in Sheet1
Sheet2 is the sheet that has the data stored as names separately
$A:$A is the rows that have the two names together
FALSE is because it's an exact match
This will return FALSE if the element does not exist, and TRUE if it does
You can also use:
=VLOOKUP($A1&" "&$B1,Sheet2!$A:$D,3,FALSE)
If you want to retrieve data for a match.
Finally, if you need to do your lookups the other way, take a look at this thread for some ideas on how to split the string into two pieces.