I have an Excel spreadsheet with multiple sheets. Sheet 1 has a lookup value in column A that, if it exists in another sheet, I want to return the value from the cell on the same row in the other sheet but from column D. I have managed to get it working if I hard code the sheet:
=IF(ISERROR(MATCH(A6,Sheet2!B:B,0)),"",INDEX(Sheet2!B:B,MATCH(A6,Sheet2!B:B),0))
I don't however want to restrict the search to Sheet2. I have tried to generate a named range SheetList to use with INDIRECT() to replace the lookup array like this:
=IF(ISERROR(MATCH(A6,(INDIRECT("'"&SheetList&"'!B:B")),0)),"",INDEX(INDIRECT("'"&SheetList&"'!A:A"),MATCH(A6,(INDIRECT("'"&SheetList&"'!B:B")),0)))
but I can't get it to work. I feel it is time to admit defeat and ask for help!
Thanks
Assuming you only have a few sheets to look through, you can do this quite simply with nested IFERROR statements. IFFERROR first attempts to perform a calculation - if that calculation is valid, it returns the value. If that calculation results in an error, it returns an alternat result as specified by you.
You can use this to check through each sheet, cascading down to the subsequent sheet each time it fails to find a match, as follows [Note that I have adjusted your INDEX to pull the value from column D of any sheet where column B from that sheet matches A6 on the current sheet. This may not be exactly how you want it to pull]:
=IFERROR(INDEX(Sheet2!D:D,MATCH(A6,Sheet2!B:B)),IFERROR(INDEX(Sheet3!D:D,MATCH(A6,Sheet3!B:B)),IFERROR(INDEX(Sheet4!D:D,MATCH(A6,Sheet4!B:B)),""))))
This first tries to grab column D from sheet2 where A6 is found on column B from sheet 2; if it errors, it then tries sheet 3, and if that errors it then tries sheet 4. If no match is found in sheet 4, it provides a blank response.
In case you have not solve this yet. Try...
=IF(ISERROR(MATCH(A6,(INDIRECT("'"&"Sheet2"&"'!"&B:B)),0)),"",INDEX(INDIRECT("'"&"Sheet2"&"'!"A:A),MATCH(A6,(INDIRECT("'"&"Sheet2"&"'!"B:B)),0)))
or type the sheetnames in A1 and Range in B1 then reference them
...indirect("'"&A1&"'!"&B1)...
then you can just change the value in A1 or B1 to make it dynamic :)
Related
looking for some help speeding up sorting pages on a spreadsheet.
Currently we have 4 sheets absolutely packed with UK postcodes/zip codes.
At the moment we go into each sheet and sort the entire sheet to show the information for the specific postcode we enter. (Always returns one line of info each sheet)
Is it possible to just have a separate sheet where we enter the postcode it it finds the match from each sheet and displays 1 line from all 4 sheets? Hopefully that makes sense.
A idiot's guide tutorial would be great
So, let's say we have four sheets (sheet1, sheet2, sheet3 and sheet4). They all look like this:
Create your 5th sheet. Here, I'm calling it "lookup_here". You should look up how to use vlookup formulas as I'll fail to completely explain it here for lack of time. Basically, you are :
Looking up a value (such as 5F3322 postal code) in a table array
(such as sheet1 columns A, B, C and D.... keeping in mind that your
lookup value must be in the first column of the array)
Then returning the column index (like column B is 2, column C is 3, etc).
And finally stating if you want an exact match (false) or approximate
match (true). Almost always use false.
Here is what the final output would look like, and I'll put some sample formulas below the picture.
So, you'll input your postal code value in cell B1. Then you will have formulas in B3 through D6. It will take some time to build these.
B3 Formula: =VLOOKUP($B$1,Sheet1!$A:$D,2,FALSE)
B4 Formula: =VLOOKUP($B$1,Sheet2!$A:$D,2,FALSE)
B5 Formula: =VLOOKUP($B$1,Sheet3!$A:$D,2,FALSE)
B6 Formula: =VLOOKUP($B$1,Sheet4!$A:$D,2,FALSE)
Column C formulas are similar, but the 2 before false will be a 3.
Column D formulas are similar, but the 2 before false will be a 4.
My excel have 2 sheet. First sheet contains a Target column. There is a Point Column as well. I want if the target value in between sheet2 then corresponding point of sheet2 is plased in the Point column of sheet1. I try using vlookup but its works only the value of sheet2 is exactly same, not in the range. Any help will be appricite.
Note that the sheet should give point n if it is between (n-1)*100000+1 and n*100000.
So just take D5 = ROUNDUP(B5/100000, 0) and it will work, in this specific case.
It is also likely to be much faster than using VLOOKUP.
I have a list of items on Sheet 1 with the names of each item in column A and then further information in the subsequent 5 columns.
On Sheet 2, in each of the cells of column A, I have set it so that I can pick any item from a dropdown list using data validation. I want the subsequent cells in the row to automatically assume the value of the respective cells in Sheet 1.
So if in Sheet 2, Cell A1 I select Item 3 (which is in Cell A3 on Sheet one), I want Cell B1 on Sheet 2 to have the same value as Cell B3 on Sheet 1.
I could get the result I wanted by using =IF($A3='Sheet1'!A3,'Sheet1'!B3,) and then adding each possible item but that seems really long winded and would require adding to the formula every time I added an item.
Any idea if there is a way of doing this? Sorry if my explanation is a bit confusing. My excel knowledge is not great!!
Thanks in advance
Use the Vlookup function
Next to your data validation cell, enter (assuming the first sheet called Sheet1):
=Vlookup(a1,Sheet1!a:f,2,0)
This will return the data that match for the 2nd column. For the 3rd use:
=Vlookup(a1,Sheet1!a:f,3,0)
And so on..
I am trying to find the formula that will search in column A (of worksheet "ABC") to find a value matching G4 in worksheet "XYZ" Once that value is found, return the value of the cell adjacent (column B of "ABC") to the cell in which this formula exists in worksheet "XYZ". All sheets are in the same workbook.
Thank you so much!
here's an example of what you're describing:
In spreadsheet ABC, you have a reference value in column A and data in column B
In spreadsheet XYZ, you have a matching number in column A. You'd like to pair the data from spreadsheet ABC to the value in XYZ:
If you notice the formula in the formula bar on the second picture, you'll see the vlookup formula to pull the data for this example. I also added an apostrophe in front of the formula in cell B1 (image 2) to have it display the formula. Note the formulas are slightly different since they point to different reference cells.
Also, here's a great reference for how the vlookup function works:
http://chandoo.org/wp/2012/03/30/comprehensive-guide-excel-vlookup/
Here is another solution that's closer to your adjusted question.
This solution still uses the vlookup formula. Instead of using it to associate a value on multiple rows, you can look-up a single value. (same function, different application)
Again, I'll point you to a great reference for how the vlookup function works:
http://chandoo.org/wp/2012/03/30/comprehensive-guide-excel-vlookup/
I'm not all that great with Excel formulas, and I'm trying to work out how to firstly check if a cell value exists in a column, and if it does, get the value of the next cell.
Specifically, I have a range of cells, from B31 to B39. What I want to do is see if those values occur in cells F3 to F12, and if they do, place the value from the cell directly to the right, ie column G3 to G12, in location D31 to D39.
I've tried IFs statements, match, VLookup and also tried solutions that I found on the net, but it keeps coming back with formula not valid. I've also tried the answer given in Stack Overflow :
Excel: check if cell value exists in column, and then get the value of
the next cell
, but I don't really understand the formula so I'm getting lost trying to convert my ranges to the formula given.
Here's the formula I'm trying to use.
=If (ISerror(Match (B31,F:F,0),"no match", Vlookup (b31,F,G,2,false)
Please can anyone help.
Put this formula in cell d31 and copy down to d39
=iferror(vlookup(b31,$f$3:$g$12,2,0),"")
Here's what is going on. VLOOKUP:
Takes a value (here the contents of b31),
Looks for it in the first column of a range (f3:f12 in the range f3:g12), and
Returns the value for the corresponding row in a column in that range (in this case, the 2nd column or g3:g12 of the range f3:g12).
As you know, the last argument of VLOOKUP sets the match type, with FALSE or 0 indicating an exact match.
Finally, IFERROR handles the #N/A when VLOOKUP does not find a match.
Here is how I used the formula from chuffs' solution:
In Sheet1, column C5, I have first names from one list and answers to a survey, but no email address. In sheet two, column A1 and C1, I have first names and email addresses, but no answers to the survey. I need email addresses and answers to the survey for my project.
With this formula I was able to get the solution as follows, putting the matched email addresses in column A1 of sheet 1.
=IFERROR(VLOOKUP(C5,Sheet1!$A$2:$C$654,3,0),"")
Thanks a bundle, guys. You are great.
I used Chuff's answer and modified it a little to do what I wanted.
I have 2 worksheets in the same workbook.
On 1st worksheet I have a list of SMS in 3 columns: phone number, date & time, message
Then I inserted a new blank column next to the phone number
On worksheet 2 I have two columns: phone number, name of person
Used the formula to check the cell on the left, and match against the range in worksheet 2, pick the name corresponding to the number and input it into the blank cell in worksheet 1.
Then just copy the formula down the whole column until last sms
It worked beautifully.
=VLOOKUP(A3,Sheet2!$A$1:$B$31,2,0)
I have added the following on my excel sheet
=VLOOKUP(B2,Res_partner!$A$2:$C$21208,1,FALSE)
Still doesn't seem to work. I get an #N/A
BUT
=VLOOKUP(B2,Res_partner!$C$2:$C$21208,1,FALSE)
Works