I need to do vlookup for a range which is variable depending on the date
for example: =Vlookup(a2,http://mypc/[attendance.xlsx]7th March'!$AR:$AS,2,0)
so for the link of the sheet is fine no need to change, but the tab in the sheet it changes according to date:
for example:
if the date is 8/3/2022 the formula will be like this: =Vlookup(a2,http://mypc/[attendance.xlsx]8th March'!$AR:$AS,2,0)
i tried to put the value of the date in a cell and using another vlookup inside the date but it didnt work. i also tried to use indirect formula to recall the sheet link but it didnt work also showing #Ref error.
Btw the lookup value is coming from a table cell.
so any ideas please?
Related
I have a formula that checks data on another sheet that is part of a set of sheets that are calendars for given years (2019, 2020,...).
In this formula I check the number of workingdays like this:
=NETWORKDAYS(A28;EOMONTH(A28;0);INDIRECT(B28& "!B58:D73"))
where B28 is the year I want to check.
No I need a small change as I have a named range Holidays_Vacations_yyyy where yyyy is the year. This way the formula should be something like
=NETWORKDAYS(A28;EOMONTH(A28;0);INDIRECT("Holidays_Vacations_" & B28))
This way, when B28 is 2019, the formula should check named range Holidays_Vacations_2019.
But it just gives a #VALUE! error. I must be tired because I cannot find a solution. Any ideas?
Thanks in advance.
PS: In Portugal, Excel uses semicolon instead of comas as field separator.
I am trying to create a conditional format formula to colour a cell based on the value of itself, the cell next to it on the right, and whether the cell on the first row in the same column is a weekday or not.
Currently it works correctly as follows:
=AND($A$2=0,$B$2=0,WEEKDAY($A$1)<>1,WEEKDAY($A$1)<>7)
I have a lot of cells I'd like to use this formula in, so I thought about creating a cover-all formula that used the ADDRESS function.
My original idea was to use:
=AND((ADDRESS(ROW(), COLUMN()))=0,$B$2=0,WEEKDAY($A$1)<>1,WEEKDAY($A$1)<>7)
(I've changed just one cell reference here for example, but I'd like to change all 4 if possible).
However, when I try to use ADDRESS(ROW(), COLUMN()) in place of an absolute cell reference, the formula doesn't format the cell anymore.
Is there a way to make this cover-all formula work so that I don't have to go through and change the referenced cell values each time for every cell? Am I missing something about the syntax? Or will this simply not work the way I'd like it to? Thanks in advance!
ADDRESS returns a string that looks like a cell address and "$A$2"<>0.Wrap the ADDRESS in INDIRECT or rewrite your original without absolute rows.
=AND(indirect(ADDRESS(ROW(), COLUMN()))=0, indirect(ADDRESS(ROW(), COLUMN()+1))=0, WEEKDAY($A$1)<>1, WEEKDAY($A$1)<>7)
=AND($A2=0, $B2=0, WEEKDAY($A$1, 2)<6)
I'm trying to get the value in one cell to be used to reference another cell.
So far what I've found is that the following formula should do the trick but somehow I can't get it to work.
In cell E5 I have the sheet name which is build up as XX-XX-XX-XX in which the XX's are all numerical values.
In another cell I want to have the data that's in cell D2 from the sheet 12-12-12-12.
I have tried the following formula but something doesn't seem to work:
=INDIRECT("'"&E5&"'!"&"D2")
If I check out the formula in error check it goes to this before it fails:
=INDIRECT("'12-12-12-12!D2")
Does anyone know a solution for this?
=INDIRECT("'"&E5&"'"&"!D2")
or if you want the cell reference separate from the !
=INDIRECT("'"&E5&"'"&"!"&"D2")
I'm trying to utilize a row and a column header to build a function that I can fill across an excel table (range of cells, not excel table object). So, for example I have a row header "BAT61" and column headers "A","B","C"...
I'd like to create a formula that generates the following results in those columns: =min(BAT61A),=min(BAT61B), =min(BAT61C)... Where those generated names match named ranges that have already been created.
I've attempted to use =index without success (I generally get a #ref error). I'd prefer a non-vba solution, if at all possible. Any help is appreciated.
UPDATE:
I've tried the indirect function but gotten the same #ref error. I've verified that the named range exactly matches the text string I'm trying to pass. I've tried the following variations with the same result #ref: =min(indirect(A1))[where A1 is the cell with "BAT61A"], =min(indirect(BAT61A))[to try and get the result directly], and =min(indirect(A1&A2))[where A1="BAT61" and A2="A"]. But, when I create a "Test" range, like suggested-it works. Any further ideas would be appreciated.
UPDATE2: I was able to get it working with several slight modifications. My named ranges that did't work were actually referring to fairly extensive array formulas that were parsing select rows from a table. When I created new dummy columns in the table that basically did the filtering, the indirect would pull the correct columns based upon the indirect.
Name some cells "Test" then you can use:
=MIN(INDIRECT("Test"))
http://www.cpearson.com/excel/indirect.htm
The name can be constructed using the & operator = $A1&B$2
For reference of others, use the function "Address" and "Indirect" in combination to achieve the above behavior.
Here is a sample for using values in cells to create formulas
=INDIRECT(ADDRESS(E6,K2))
Assuming cell
E6 holds 3 and
K2 holds 4
The above formula will return
=INDIRECT($C$4)
Assuming cell
C4 holds This is a test
The above formula will return
This is a test
I have to use the following formula to format a cell based on a range of cells.
=IF($D$35=$AD$34+$A$3,1,IF($D$36=$AD$34+$A$3,1,IF($D$37=$AD$34+$A$3,1,IF($D$38=$AD$34+$A$3,1,IF($D$39=$AD$34+$A$3,1,IF($D$40=$AD$34+$A$3,1,IF($D$41=$AD$34+$A$3,1,IF($D$42=$AD$34+$A$3,1,IF($D$43=$AD$34+$A$3,1,0)))))))))
The range of cells is D35 to D43. The condition to be met is a specific date (designated by AD34+A3). The formula above works perfectly. However, I know there is a better way. I have tried using INDIRECT, and OFFSET commands to specify the range of cells. I have not been able to get the syntax right.
I have worked on this for days, can someone please show me what i am missing? I would prefer a solution that does not require VBL.
=IFERROR(MATCH(AD34+A3,D35:D43,0),0)