Look up value, on another Excel sheet - excel

I have a small list of names with no emails on sheet one, and on another sheet (sheet 2) I have the master list of names with their emails in the adjacent column.
I want to look up the email associated with the name from the master list (sheet 2), and place it on the first sheet.
Here is what the data looks like:
Sheet 1:
Sheet 2:
In the first sheet I tried to use VLOOKUP to match the name with the emails on the other sheet.
My equation was
=VLOOKUP(A8,Sheet1!A1:B285, 1, FALSE)
This ... did not work. Any idea on where to go from here?
Thanks.

Your formula is:
=VLOOKUP(A8,Sheet1!A1:B285, 1, FALSE)
If you take a look at VLOOKUP description, you will find the following description of the first parameter:
The value you want to lookup. The value you want to look up must be in the first column of the range of cells you specify in table-array.
So your formula tries to find name in email column.
One possible solution is to change the order of columns in the look up sheet and use:
=VLOOKUP(A8,Sheet2!A1:B285, 2, FALSE)
(make sure the sheet name is right, it is not clear what are the names of both sheets).
More universal solution is to use INDEX/MATCH combination:
=INDEX(Sheet2!$A$1:$A$285,MATCH(A8,Sheet2!$B$1:$B$285,0))

I think you have to put your equation like this:
=VLOOKUP(A8,Sheet2!A2:B285, 1, FALSE)
because in your equation you are making reference to the first sheet, I mean you want to find a value in the same table as you are searching.
I expect it will works. Let me know if it is wrong.
EDIT: When I put A2:B285 it's because I suppose that the table in your sheet2 it's the full table but instead of that you have to select all the table in sheet2.

VLOOKUP requires that the first column on Sheet2 is sorted in alphabetical order. Your formula (pointing at Sheet2!A2:B285) will probably work then!

Related

How do I match two conditions to return a value without a helper column

I'm working on a pretty big data set. It's got two sheets. The first one contains the name of one city and multiple ID numbers. The second sheet should be left alone/unedited (raw data). It contains multiple cities and multiple ID numbers (some of them are in the first sheet and some are not).
I want something like: if city in sheet 1 and ID number in sheet 1 is in sheet 2, then return "Ok". Preferably without any helper columns.
An example:
Sheet1
City ID Status,
Londen 12345 OK,
12346 OK,
Sheet 2
City ID,
Londen 12345,
Mumbai 12333,
Londen 12346,
I've tried something like
=INDEX(Sheet2!A:B,MATCH(B2,Sheet2!B:B,0),0)
But I have not figured out yet how to add another condition and add the "OK".
I thought of using VLOOKUP, but I got stuck there too since I don't want to use helper columns
Thanks in advance!
You can use SUMPRODUCT function to check if both criteria are met in your Sheet 1. i.e. City = Londen and ID is shown on Sheet 2.
In my solution I have named the City column in Sheet 2 as Master_City, and named the ID column in Sheet 2 as Master_ID.
Presume you have the city name in cell A2 on Sheet 1, and ID is listed in Column B, then you can use the following formula to get the result:
=IF(SUMPRODUCT((Master_City=$A$2)*(Master_ID=B2))>0,"Ok","No Match")
Please note I have changed your example data a little bit to test the result. And I have set "No Match" for ID that is missing on Sheet 2. You can show a blank cell by replace "Na Match" in the formula with "" if needed.
You can read the following article regarding the use of SUMPRODUCT in varies situations to help to understand my answer better.
Master Excel’s SUMPRODUCT Formula
See below screenshot for more clarifications. Let me know if you still have any questions.
Cheers :)

How to get a dynamic excel sheet out of a list, based on a value of a column

I think I need to solve this with an array formula in Excel, but I am kind of stucked.
Imagine you have an excel sheet (called main_data).
In here you have a list of people and a status for each person.
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|New|
|Benjamin|20|New|
|Carlos|30|Old|
|Denis|40|New|
Now I want on the second sheet, that only the records are shown under each other that have the status "new". (but actually without showing the status column)
Like this
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|
|Benjamin|20|
|Denis|40|
A couple of things:
- I do not want to use a pivot table, as the second sheet, which is my required end result, as it must be in a very specific format and order
- I do not want to use an autofilter. (I could add the status column in sheet 2, filter by status new and hide the column. Once I add or remove a record in sheet 1, I have to repeat that filter process)
Any ideas?
Can I do this somehow with an Array formula and add an if condition for the status column?
I tried normal IF function, index / match and Array. but none of them worked as I wanted.
This on sheet 1:
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|New|
|Benjamin|20|New|
|Carlos|30|Old|
|Denis|40|New|
turns into this on sheet 2, but dynamically, without any user interaction:
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|
|Benjamin|20|
|Denis|40|
One way is thus. If your source data are in Sheet1
then in Sheet2 put this formula in A2 and copy down and across as far as necessary. Adjust ranges to suit. It's an array formula so confirm with Ctrl+Shift+Enter and curly brackets will appear round the formula.
=IF(ROWS(A$2:A2)<=COUNTIF(Sheet1!$C$2:$C$5,"New"),INDEX(Sheet1!$A$2:$C$5,SMALL(IF(Sheet1!$C$2:$C$5="New",ROW($A$2:$A$5)-ROW($A$2)+1),ROWS(A$2:A2)),COLUMNS($A$2:A2)),"")

Data validation (Drop down) to auto-populate column with formula

I'm trying to make an excel sheet a lot smaller and easier to handle. What i'm trying to do is have a drop down auto-populate a whole column.
My original sheet looks like:
Item Name(A1) Item Code(B1) Price1(C1) Price2(D1) Price3(E1) Price4(F1)
My goal is to look like:
Item Name(A1) Item Code(B1) Price Drop Down(C1)
I also want to be able to delete an item in Column A and still be able to have the correct values. My VLOOKUP only uses 1 column and wont change (of course) when I switch to a different price set.
You could try something like this:
Copy your original table to another sheet (sheet2), so you can use it as the lookup table. In the original sheet delete the last 4 columns (C:F). Next create a dropdownmenu in cell C1, with items {price1 ,price2 ,price3 ,price4}. Put the following formula in cell C2 and copy down.
=VLOOKUP(A2,Sheet2!A:F,RIGHT($C$1,1)+2,FALSE)
The last parameter [FALSE] is necessary when the item names in the lookuptable are not in alphabetical order.

Excel - Check if value X and value Y is on the same row

I have an excel document with two sheets, data and edu-plan. The sheet data has the following information:
The sheet edu-plan looks like this:
My question is: how do i create an excel formula that checks if the target group on the specific row in edu-plan! has the course name in question on the same row as the target group in sheet data!, i.e. if Sales and Sales course is on the same row in the sheet data!?
In reality, the data sheet as a couple of hundred rows and will change over time, so i am trying to develop a formula that i can apply easily on all rows/columns in edu-plan!.
The desired result in edu-plan would look like this:
A pivot table might be a good way to go.
If you would like to do it by formula, then you can just use a COUNTIFS
=IF(COUNTIFS(data!$A$2:$A$10,$A2,data!$B$2:$B$10,B$1),"X","")
A possible way to solve your issue with an array formula:
Write in B2 of sheet edu-plan
{=IFERROR(IF(MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)>0,"x",""),"")}
Since it is an array formula, you need to hit shift + ctr + enter.
Here is the formula broken down:
MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)
checks whether the combination of row header and column header is in the data table. MATCH returns the index of the found combination. Since we are not interested in the location, we only ask IF(MATCH > 0, "x", "") to write an "x" if a match was found. If MATCH finds nothing, it returns an error, which is why we add an IFERROR(VALUE, "") around the construct.

Excel How can I direct columns by their headline?

Currently I have a huge formula in my excel sheet:
=SUM(SUMIF(INDIRECT(A9&"!$F:$F"),"working";INDIRECT(A9&"!$B:$B"))+SUMIF(INDIRECT(A9&"!$F:$F");"Open";INDIRECT(A9&"!$B:$B"))+SUMIF(INDIRECT(A9&"!$F:$F");"internal",INDIRECT(A9&"!$B:$B"))+(SUMIF(INDIRECT(A9&"!$F:$F"),"finished";INDIRECT(A9&"!$AP:$AP"))))
In A9 is the name of the excel sheet that the formula has to use. So for example in A3 there's '20140612', so it has to use the excel sheet with the name '20140612'. Furthermore it sums up some values depending on some conditions.
My question is: I would like to direct the columns in the other sheets by their headlines, not their positions in the sheet. So for example le column AP doesn't always has to be in the position AP, but has always the headline 'Points'.
Can you think of an adaption of the formula that can direct the column by their headline?
I though of the MATCH formula. But I'm not to sure where I have to put this in.
I think the simplest answer would be to use named ranges within your sheet. In this way you could name a range (currently in column AP) as 'Points', change your formula to use 'Points' instead of '$AP:$AP' & if you move your points data about the formulas would be unchanged.
If you are planning to keep changing your header row values then you could use HLOOKUP to match up the header column probably in conjunction with MATCH & INDEX.
To answer your question about the usage of MATCH(), it's worth thinking of it as half of a VLOOKUP() or HLOOKUP(), i.e. it's the bit that finds the row or column containing the value you're searching for, then you can use INDEX() to get that row / column from a range you specify.
So, if you know that one of your column headings is "Points", then you could find it by using:
=MATCH("Points", A1:Z1, FALSE)
...which would return 10 if "Points" were the heading of column J for example. If you wanted to then use that column for a lookup, you can use OFFSET() to define that column as a range to use for a lookup, so let's say I wanted to find the text "foo" in the "Points" column, I could use:
=MATCH("foo", OFFSET(A1:Z1000, 0, MATCH("Points", A1:Z1, FALSE) - 1, 1000, 1), false)
... which uses the column index I found before as an input to OFFSET() in order to dynamically reference J1:J1000 and then search for "foo" in that column.
For your example in the question, rather than A1:Z1000 you could use a call to INDIRECT() that would return the entire range of interest from your source sheet.

Resources