using filename in vlookup - excel

I am trying to find a non-vba solution for getting a value via vlookup. The vlookup should use the sheet name as the search criteria. The sheet name format is "00000"
=VLOOKUP(N1;[otherfilename.xlsx]othersheetname!$A$3:$C$10000;3;false)
when writing "12345" into Cell N1 it work perfectly fine
when writing in Cell N1:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]", CELL
("filename",A1))-FIND("[",CELL("filename",A1))-6)
the Cell returns also "12345" but VLOOKUP does not work anymore.
Why is this different to straight putting a value into the Cell?
How do I solve this?
Solution:
Wrapping VALUE() around MID()

If you want to reference the location that is generated from string you should use INDIRECT() like this:
=INDIRECT("[otherfilename.xlsx]othersheetname!$A$3:$C$10000")
This will return values from the range in desired sheets.

Related

Return contents of the cell above the one indicated in VLOOKUP using ADDRESS, INDEX, MATCH, and/or CELL function

I am trying to use a date in Sheet 1 and using Vlookup to find this date on Sheet 2 and return the value/contents onto to a cell in sheet of the cell directly above that date in sheet 2.
This is the Formula I used that you can see
=INDEX('AUSSIE Dly'!$A$3:$A$2000,MATCH($B$9,'AUSSIE Dly'!$A$3:$A$2000)-1)
I have tried using Index and match but to no avail. Please help.
You should use
=INDEX('AUSSIE Dly'!$A$3:$A$2000,MATCH($B$9,'AUSSIE Dly'!$A$3:$A$2000, 0)-1)
The added zero indicates using an Exact Match.

Unable to use SUBSTITUTE(ADDRESS(MATCH))) combination as a range in a LOOKUP function in Excel

I have an Excel sheet containing a matrix of [Year & Week number] in rows and [name of Employees] in row1 giving values of available weekly hours.
I am able to successfully use the Excel formula
=LOOKUP(2,1/((A:A=2018)*(B:B=31)),D:D)
at cell F2 for a reverse lookup. It gives the result 15 correctly.
However, I wanted to replace range D:D in the above formula to a dynamic range by identifying the column when the employee is known.
So I tried replacing by the formula
SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1","") &":"&SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1","")
This portion of the formula works and gives D:D for Employee2. This is shown to work in cell F4.
But the revised formula gives an error of #Value! at cell F6.
It says "A value used in the formula is of the wrong data type."
The revised formula which does not work is:
=LOOKUP(2,1/((A:A=2018)*(B:B=31)),SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1","") &":"&SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1",""))
I hope someone can help show me where I am making an error in trying to replace range D:D in the LOOKUP formula with the combination of SUBSTITUTE, ADDRESS & MATCH functions.
Thanks to all trying to help in advance.
You cannot just plug a string, which is what SUBSTITUTE returns into a formula.
You can use INDERICT to turn the string into a viable reference:
INDIRECT(SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1","") &":"&SUBSTITUTE(ADDRESS(1,MATCH("Employee2",1:1,0),4),"1",""))
But both INDIRECT and ADDRESS are volatile.
Use instead INDEX to return the correct column:
INDEX(A:AAA,0,MATCH("Employee2",1:1,0))
So your formula is:
=LOOKUP(2,1/((A:A=2018)*(B:B=31)),INDEX(A:AAA,0,MATCH("Employee2",1:1,0)))

Send cell value as a parameter to use it as a value criteria for vlookup formula

I have the following as target:
In another workbook, I have as a data source this table:
So, using VLOOKUP formula I'm retrieving the values that I want for the cell just with formulas like that:
=CONSULTAV("user1";login.xlsx!Tabla1[#Datos];2;FALSO
CONSULTAV is the spanish formula for VLOOKUP, so I guess in english (just for better understanding as this is a english website) should be something like:
=VLOOKUP("user1";login.xlsx!Table1[#Data];2;FALSE
I want to type in the cell a simpler formula , something like:
=FindValue("user1")
So that formula calls the VLOOKUP formula and just uses the value as first argument for the VLOOKUP formula for searching the value.
Assuming the following data layout,
Select B3 and then create a defined name with the following parameters,
That formula is,
=VLOOKUP("password"&RIGHT(Sheet4!B2, 1), Table1[#All], 2, FALSE)
Now use =FindPassword in B3.
This method will always find the password associated with the user in the cell directly above it.

Formula works in excel, but name does not

I have this formula in excel, to return a row number:
=MATCH(INDIRECT(ADDRESS(ROW(),4)),DayOffRequests!$A$1:$A$100,0)
and it works just fine.
I would like to make a new name (DAYS_OFF_ROW) and assign it to this formula.
Here's what I did in the name manager:
But when I write this into a cell: =DAYS_OFF_ROW it says #VALUE! whereas when I write the same formula into the cell, it gives me the row number I am looking for.
Why is does it say #VALUE! and not the row number like the formula does?
First off Row() returns the row on which the cell resides. If you put Row() in indirect you will get an error since there is no cell for which Excel can find a Row(). So right off the bat, your formula is nonsense for a named range.
Second, even if there was some magic way for Excel to know which Row() you cared about here, Match doesn't return a range. Just a position in an array like "5" or "50". When you use a formula to define a named range, the result of the formula MUST be a range. So you could do another Indirect like =Indirect("A" & Match(foo,bar)) or something so that the result out of your formula actually refers to a range in your sheet.
It works if i set the name to this formula: =MATCH(!$D1,DayOffRequests!$A$1:$A$100,0)
Of course i have to be in field A1 when setting the name. Now its reference the fourth column and whichever row i am in.

Reffering value from other cells in SUMIFS function

I need to use SUMIFS function in Excel 2007, currently my formula looks like this:
=SUMIFS(D:D,B:B,"=string",c:c,"=E")
Now the value of string is placed inside cell A3 of sheet1.
Is there any way through which i can refer that value in SUMIFS formula like sheet1!$A$3
I try following code but it didn't work:
=SUMIFS(D:D,B:B,"=sheet1!$A$3",c:c,"=E")
why don't you directly reference that cell without quotes? such as:
=SUMIFS(D:D,B:B,sheet1!$A$3,c:c,"=E")

Resources