very new to this and only just managed the vlookup, anyway,
i have a workbook which contains two Sheets. On Sheet1 I have the following formula (=VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE)) which displays the ID number from Sheet2. This works correctly but how do I get to appear as a hyperlink so once clicked it goes to the specific cell it got from the vloopkup on Sheet2?
I have tried =HYPERLINK(VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE) but I get the error "Cannot get the specified file".
I would be grateful if anyone can point me in the right direction, thank you.
Ok... this looks crazy. This should work for you. I tested it on my machine and it works:
=HYPERLINK(MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1) & ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2"),VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE))
Let's break it up a little just to explain some of the parts:
MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1)
Returns a string [currentFileName], which is the required format for a hyperlink within a workbook.
MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the row number of value of CZ54 in the first column of your VLookup range.
ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the address of the row found, and the column(3, from your vlookup) in sheet2.
So combined:
MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1) & ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the actual address for the hyperlink, which is the first parameter of the HYPERLINK formula.
The second parameter is the Vlookup you provided, and voilĂ .
Edit: A warning if anyone tries to use this for a similar issue, if the lookup_array used in Match or Vlookup does not start with Row 1 or column 1 respectively, you will need to offset the values sent to ADDRESS with a +(starting row or column - 1). Example: Match(CZ54,$A$2:$A$176)+1 instead of MATCH(CZ54,Sheet2!$A$1:$A$176).
Here's a more compact version of Daniel's formula.
Using Hyperlink to link to another sheet in the same workbook, you can replace the reference to the workbook name with #.
Eg =HYPERLINK("#Sheet2!$C$10","Click Here")
So, applying this you get
=HYPERLINK("#"&ADDRESS(MATCH(E21,Sheet2!$A$1:$A$176),3,,,"sheet2"),VLOOKUP(E21,Sheet2!$A$1:$Y$176,3,FALSE))
HYPERLINK is looking for text so if you were to do something like
=HYPERLINK(left(VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE),255))
it should return a usable hyperlink
Related
I have an excel worksheet i use to create a coverage matrix for test planning. requirements v testcase.
I have been trying to use the formula below to return the correct cell reference (eg cell d10 for example) whereever a cell has a tick in my worksheet selected range but using the formula below whilst i get the right row number the column name is always given as A
=IF(ISERROR(MATCH("P",C7:DB7,FALSE)),"NO",CELL("address"))
Can anyone help?
Thanks in advance
The CELL("address") function will return the address that the formula is in.
The quick and dirty solution to your question is the following:
=IF(ISERROR(MATCH("P",C7:DB7,0)),"NO",ADDRESS(7,MATCH("P",C7:DB7,0)+2))
Note that 7 and +2 are hardcoded because your range is in column C and row 7
This will only find the address of the first tick
Solved using callumDA33 solution i changed 7 to read Row() and that worked i am now getting correct row and column
so solution looks like =IF(ISERROR(MATCH("P",C3:AH3,0)),"NO",ADDRESS(ROW(),MATCH("P",C3:AH3)+2))
Here is my question. I have tried to use Vlookup and receive an #NA and then I have tried to use Index Matching and the formula breaks and the returns are not all present. I receive some 0's and some #REF!'s in the column of my formula.
This is what I am trying to do. I have workbook with 2 work sheets. The first worksheet called 'brazil' is where I have written my formula in the column D.
Now, what I am trying to do is match up the email address from worksheet 'brazil email' and the worksheet from the 'brazil' and then pull the information from the cell in the 'brazil' worksheet a column that matches with the email from the formula.
The snippet shows the formula works in row 3 column D and returns the information from column A(employee), but breaks after a few rows and works intermittently.
Current my formula looks like this: =INDEX(A2:A34, MATCH(C2, 'Brazil email'!$A$2:$A48, 0))
Here is the snippet of the other worksheet: enter image description here
If you have any ideas on what could be causing the breakdown of my formula, that would be great.
I am willing to share a sample of the spreadsheet with you if needed. Thanks for any help. :)
Any other methods, like an alternate vlookup or vba would be great. :)
UPDATE 3/15:
I was able to update my formula and locked it down as per the great advice given on the below comment. :)
This is the latest update. I am still receiving #REF! on some of my cells. I copied and pasted in case there was a space and verified that the column is set to general and not text.
What could possibly be giving me the #REF! when it should be the data from the matched and index cell. I see the other rows worked but for some reason some of the cells on column D didn't update with the data from column A.
Please assist since I have 25,000 lines of this I have to sort through and trying to work smarter not harder. :)
I have removed the original snippet since the update given has corrected some of the errors. Here is the latest image with the current #REF!, Please assist: enter image description here
Looking at your formula, it seems that the first parameter should be locked:
=INDEX($A$2:$A$34, MATCH(C2, 'Brazil email'!$A$2:$A$48, 0))
When you copy your formula down, Excel will shift that first bit out of bounds.
UPDATE:
The #REF! usually comes from copying/pasting formulas or deleting/moving referenced data.
What I can think here is to make sure to put the working formula in the top cell and paste all the way down.
Also important: Added another lock to the formula (didn't see it before), on the referenced range inside the MATCH section.
I know the formula for inserting the filename, however the file is e.g 54321 Cost Data and I just require to insert the 54321.
Is it possible to insert into a cell the first five characters of the filename?
Please try:
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,5)
.
#barry houdini has kindly pointed out that the above is flawed (in a way that may not often be an issue but could at times be very confusing):
It's better to use a cell reference in CELL function with this formula, e.g. =MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,5) - that ensures that the filename used in the formula is the same as the filename where the sheet resides. If you don't do that, and you go in to another workbook and change a cell in that workbook your formula may return a different result, i.e. based on the name of the 2nd workbook.
The syntax for CELL is:
CELL(info_type, [reference])
reference Optional. The cell that you want information about. If omitted, the information specified in the info_type argument is returned for the last cell that was changed.
So 'my' formula should work when first placed in a cell. Might still be working when that cell is next viewed. All seems in order - until the day the displayed value is different and not as a result of any change to the workbook the cell is in. Such behaviour is not what I would describe as 'conventional' for Excel. Even if the last cell that was changed was in a different workbook the cell giving me the value I expect for this workbook may change what is displays.
So better to 'play safe', do as #barry suggests (as always!) and add the 'optional' reference.
I would like to use a VLOOKUP function referring to a data table placed in a different sheet from the one where the VLOOKUP function in written.
Example: in Sheet 1, cell AA3 I would like to insert the VLOOKUP function.
I want the function to check the number in cell M3, find the same number in Sheet 2 range address A2:Q47 first column, and reproduce the value in the 13th column of that table.
I've written this function but it reports #N/A as a result:
=VLOOKUP(M3,Sheet1!$A$2:$Q$47,13,FALSE)
One of the common problems with VLOOKUP is "data mismatch" where #N/A is returned because a numeric lookup value doesn't match a text-formatted value in the VLOOKUP table (or vice versa)
Does either of these versions work?
=VLOOKUP(M3&"",Sheet1!$A$2:$Q$47,13,FALSE)
or
=VLOOKUP(M3+0,Sheet1!$A$2:$Q$47,13,FALSE)
The former converts a numeric lookup value to text (assuming that lookup table 1st column contains numbers formatted as text). The latter does the reverse, changing a text-formatted lookup value to a number.
Depending on which one works (assuming one does) then you may want to permanently change the format of your data so that the standard VLOOKUP will work
I faced this problem and when i started searching the important point i found is, the value u are looking up i.e M3 column should be present in the first column of the table u want to search
https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
check in lookup_value
Your formula looks fine. Maybe the value you are looking for is not in the first column of the second table?
If the second sheet is in another workbook, you need to add a Workbook reference to your formula:
=VLOOKUP(M3,[Book1]Sheet1!$A$2:$Q$47,13,FALSE)
There might be something wrong with your formula if you are looking from another sheet maybe you have to change Sheet1 to Sheet2 ---> =VLOOKUP(M3,Sheet2!$A$2:$Q$47,13,FALSE) --- Where Sheet2 is your table array
This lookup only features exact matches. If you have an extra space in one of the columns or something similar it will not recognize it.
I have faced similar problem and it was returning #N/A. That means matching data is present but you might having extra space in the M3 column record, that may prevent it from getting exact value. Because you have set last parameter as FALSE, it is looking for "exact match".
This formula is correct: =VLOOKUP(M3,Sheet1!$A$2:$Q$47,13,FALSE)
Copy =VLOOKUP(M3,A$2:Q$47,13,FALSE) to other sheets, then search for ! replace by !$, search for : replace by :$ one time for all sheets
I've been working on VBA for so long I forgot how to do this...using formulas.
I have a cell that has a descriptor in it, in this case K1122121. The cell next to it, will be the description. On another sheet I have a list of parts, I need to look up said part number on sheet 2, and place the description next to the part it's looking up.
I know it's possible, I just forget how.
So to recap.
Sheet one has two cells, the first is a part number, the 2nd next to it, is where the formula is going, in this cell will produce the description to said part number.
Sheet two has part and description side by side. I need to reference the part number and find the description.
Once the description is found, place said description in the description field in sheet one.
Thanks for the help.
Here is a link of what I am working on. https://dl.dropbox.com/u/3327208/Excel/PAERTO.xlsm
It's called VLOOKUP and you call it like this:
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
Where:
A1 is the cell with the part number in sheet1
Sheet2 the sheet where the data is located (descriptor / description)
A:B is the range in sheet2 where the data is located
2 because what you are looking for is in the second column
FALSE to only get a value for exact matches - if no exact match is found, it will show an error
EDIT
Looking at your workbook, I would personally insert a new column in the jobs list (say between D and E) with a formula that only keeps the first word only - formula in E3:
=IF(ISERROR(FIND(" ",D3)),D3,LEFT(D3,FIND(" ",D3)-1))
Then the formula in the PAERTO sheet then becomes - formula in D20:
=VLOOKUP($E20,'Jobs List'!$E:$F,2,FALSE)
in the example you provided, I get a result for lines 20, 22 and 24, and an error on the other lines.
I can get a result if I use this formula:
=VLOOKUP(E20&" Rev"&F20,'Jobs List'!D:E,2,0)
However you need to change cell F20 to 4.
As long as part number and "Rev" are consistent between sheets, this formula should work.
Note that only cells D20 and D24 return values. The other part numbers don't exist on the other sheet, so regardless of what formula is used you will not see a return value.
With your part number in A1, in B1 the formula =VLOOKUP(A1,Sheet2!A:B,2,FALSE) will find the description
If you are on Excel 2003 or earlier, you will have to change Sheet2!A:B to be a full reference like Sheet2!A2:B2000
The answer was a little more complex than I was hoping, but I ended up using this as an answer. It may not be the most simplistic, or elegant, but it works.
=IF(E20=0,VLOOKUP("*"&E20&"*",'Jobs List'!D:E,2,FALSE),VLOOKUP("*"&E20&"*",'JL Archive'!D:E,2,FALSE))
I used the "*" to make it so that it utilized wild cards, something I never thought of using... but it works. I put the wildcard usage in front and behind so just in case any cells may have something more than the required text in the front of the part or behind it.
I hope this helps people. The original use for this was so I can use the formula can be used from another workbook, but as we all know this can be used anywhere. Enjoy :)