Lookup in excel with no VBA - excel

I am trying to compose an excel spread sheet on which there would be two sheets.
One sheet (sheet2) with a list of names in one column and next to each name a number.
I would then this column of names as a list for a drop down list in another sheet (sheet).
What I am trying to work out is when I select a name on the drop down list, the number next to the name on sheet2 will be displayed on the cell next to the drop down list.
I am trying to use lookup but it does not seem to work, I guess I am using it wrong.
This is the formula I am using which is placed on the cell next to the drop down list and the drop down list is on A1 in Sheet1.
=LOOKUP(A1,{+Sheet2!A2:A7,"d";+Sheet2!B2:B7})
Sheet2!A2:A7 is the list of names
Sheet2!B2:B7 is the list of respective values for each name.
Any help would be much appreciated.
Thanks.

=vlookup(A1,Sheet2!$A$2:$B$7,2,0) should return the proper value, as Tim WIlliams suggested.

Related

Excel Formula to sum cell over multiple sheets

I have an Excel document that I need to have a totals sheet which takes in a specific cell over multiple sheets. It also needs to be expandable so I can just add the sheet name to a row or something and it will add it into the formula and the total.
Just a row like this or something similar which could be used to add more sheets in future.
To give you an example currently, I am using a simple SUM function but it's not easily expandable:
=SUM('Sheet1'!A6,'Sheet2'!A6,'Sheet3'!A6)
I have had a look at INDIRECT but I can't find a way of having it expand to the length of an array eg. something like this:
=SUM(INDIRECT(H3:H8,"!A6"))
Would return all the values of A6 across each sheet named in H3:H8 evaluating like:
=SUM(INDIRECT(H3,"!A6"),INDIRECT(H4,"!A6"),INDIRECT(H5,"!A6")...)
If anyone has any ideas of what I can use to achieve this, it would be very helpful!
If you want a dynamic list of sheets for your sum formula, you may
Put the names of the sheets across which you would like to sum your cell(s) on a separate range of cells organized as a column range:
Sheet1
Sheet2
...
Convert the cells with the names of sheets into a table (select your range, then on the main menu panel select "Insert - Table").
Name the created table list (i.e. "List_of_Sheets")
To sum use the formula:
=SUMPRODUCT(SUM(INDIRECT("'"&List_of_Sheets&"'!A6")))
You may change the names of sheets in your table or add the new ones at the end of the table
Try this,
SUM(Sheet1:Sheet3!A6)
You can add a Sheet named „Start“ and one named „End“.
Place all sheets you want to sum between the both. So you can use
SUM(Start:End!A6)

Fill data in excel sheet from master list from another sheet

I have data in two separate excel sheet in single file.
In the first sheet, I have two columns...like this
Sheet1
In the second sheet, I have one of the column which is same as Name in Sheet1. However, it does not have second column where I want to bring the value referring to the sheet 1.
Here is the second sheet.
Here in second column, i.e. Color I want to bring the value from first sheet.
I am using Libreoffice but can use excel as well. Pls suggest how I would do this in excel / libreoffice.
Solution for Excel...
So use sheet one as the reference sheet. Sheet two as the one you want to fill.
In B2 on Sheet 2 enter this formula:
=vlookup(A2,Sheet1!$A$1:B$6$,2,FAlSE)
Then drag down.
This is assuming that your reference in sheet one is in columns A and B and goes from rows 1 to 6.
Hope this helps.
One of the easier ways to do this would be to use VLOOKUP. So this requires 4 inputs:
The value you are searching for
The array you are searching in
The column where the value you want to return is in
"FALSE" to list if you want an exact match between the value you are searching for and the array you are searching in.
So in your example, we will use the worksheet where you only have the Names listed as the worksheet you are putting the formula, so something like this in B2:
=VLOOKUP(A2,sheet2!$A$2:$B$6,2,FALSE)
So this would lookup the value you show in worksheet 1 cell A2.
Then go to workbook 2 and match that value with what is in A2:A6.
Then lookup what is in column 2 for your answer.
And return what is in column 2 only if worksheet 1 cell A2 and something in worksheet 2 range A2:A6 is an exact match.
There are other ways, but for your example, this should be easiest in EXCEL. This only works if the value you are searching for is to the right of the value you are looking up. If you need to go to the left, INDEX/MATCH would be better (but not required here).
Hope this helps!
JW

How to get a Drop down populated with sheet names to fill range of sheet cells?

Hi I hope someone can help.
I have a workbook column A is populated with titles leaving column B for data.
There is only these 2 columns in use.
I have the same titles in column A replicated on a series of sheets with column B filled out with client data.
On my first sheet (no data in column B) I'm attempting to use a single drop-down populated with the names given to the sheets on my workbook.
When a sheet name is selected from the drop-down This is to fill in the data from the corresponding sheet.
It's worth noting that all the titles are in the same cells on each sheet.
I can amalgamate all the client data onto one sheet if it's required for a solution but require one set of the data from a single drop-down on a separate sheet
I thought I might manage this with with some kind of range Vlookup linked to a separate sheet with the individual sheet names but i can't get my head round it.
Any help greatly appreciated.
Generally I use formulas in excel so if it's possible with VLookup or similar that's great if not then please drop some code for VBA.
From your description, Sheet11 is a customer data sheet and looks like this ...
The sheet that is looking up customer data looks like this ...
Cell D2 contains the drop down list to choose which customer data sheet to look at, in this case Sheet11.
Cell B2 contains the following formula, filled down...
=IF(ISERROR(VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE)),"",VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE))
It constructs a string representing the customer data to look in, and uses the INDIRECT function to convert that string into a valid reference. It uses VLookup to find the data of interest. If VLookup returns an error, a null string is returned, otherwise the customer data is returned.
Note: When constructing the string, the sheet name is enclosed in single quotes, in the event there is a space in the sheet name.

How can I search across Excel sheets?

I want to transfer data automatically from 2 sheets to one single combining one. That means I have 2 different export sheets (called 'Te_open' and 'Te_closed') that contain both the columns "Problem" (in different positions, can vary always). I have one sheet, that represents an overview of the data from the two other export sheets. So when I have for example the value "Te1" in the cell A2 of my overview sheet, I want Excel to search in the two export sheets the value "Te1" and give back the value in the same row as "Te1" but of the column "Problem", so that I can fill the cell B2 where I want to have the Problem type. So I thought I might need the "MATCH" formula, to let excel know I want to search the column with the headline "Problem" in the export sheets, to fill the column "Problem" in my overview sheet.
The problem that I see is that I have to search TWO sheets and I don't know in which one the "Pm1" will appear. Furthermore I don't know in which column of the sheet "Problem" will appear.
Can you please help me? I would preferably like to solve the problem with a formula, not a macro. Thank you very much in advance.
Kind regards,
question
To find the index of the first column in one of your sheets that is headed 'Problem', you can use (e.g.):
=MATCH("Problem",Te_open!$1:$1,0)
Let's assume we place that formula in a cell somewhere and name the cell open_col. To find a value in column A of Te_open and return the corresponding value from the 'Problem' column, you can then use:
=VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
Note that you'll have to define the search range to include the largest range that your data on Te_open could occupy. If the search value is found this will return the corresponding value from the 'Problem' column, otherwise it'll return #N/A. So if you've also set up a cell called closed_col to get the column index for the Te_closed sheet, you can do:
=IF(ISNA(VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)),VLOOKUP(A2,Te_closed!$A$2:$Z$999,closed_col),VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
That gets the result from the correct column of Te_open if the search value was found there, otherwise it gets the result from the correct column of Te_closed. If neither sheet contains the search value it'll return #N/A.

Excel contains filter with more than 2 values

Does anyone know how I can quickly hide/remove all rows in sheet1 that contain any of the rows info from sheet2?
It would need to contains filter as it wouldn't be an exact match.
For example
Sheet1:
http://www.google.com/something/else
http://www.yahoo.com/whatever
www.microsoft.com/hahha
Sheet2:
google.com
So the end result would be the first line in Sheet1 would be hidden
In practice I'm working with thousands of rows in sheet1 and around in Sheet2.
To clarify, I'm essentially trying to do a contains filter with more than 2 values - the default filter only allows 2 values.
Also I am working with Excel for Mac 2011.
You can do this quickly with a simple helper column without a large range loop.
For simplicity as a sample:
Assuming your Sheet 1 list was in A1:A1000
your Sheet 2 partial list was in C1:C5 (on the same sheet for the picture below)
then in range B1:B1000 enter this array formula,
=MAX(IF(ISERROR(FIND($C$1:$C$5,A1)),0,1))=1
(Enter as an array formula by pressing Ctrl+Shift+Enter)
Then AutoFilter the TRUErows (which flag any matches) and hide them
As i was reading the solution posted by #brettdj I think it should work for your problem.
From your comment it seems you have an empty cell problem when using his solution. Are you sure you replaced the $C$1 : $c$5 with the right values?
In your case you should first refer to the right sheet (Sheet2 if you didn't rename it) then the right column (assuming you have it in column A of sheet2).
You should write =MAX(IF(ISERROR(FIND(sheet2!$A$1:$A$5,sheet1!A1)),0,1))=1.

Resources