Excel VLOOKUP #REF Error - excel

I'm trying to create an integrated athletic planning and training calendar. Part of this is for one sheet to identify weeks in which races occur based upon races and dates identified by the user on another sheet. I've confirmed that my VLOOKUP is not referencing a non-existent column and that the cell style is General for those applicable.
Here is the formula:
=VLOOKUP(Periods!A6,Races!$F$2:$F$20,2,FALSE)
The Lookup Value is the Training week on the first image and is used to identify races on the target worksheet. Each row on that sheet has a different training week. I am trying to get Column D (and F) on the formula sheet to show the priority of the race if there is one planned for the applicable week.
Any help is appreciated.
Thanks!
Mike

the ,2, in your vlookup here =VLOOKUP(Periods!A6,Races!$F$2:$F$20,2,FALSE) means go to the right of column F2:F20 if a match is found in column F, but, you need to specify F2:G20 for that to work in your vlookup formula. (which still won't give you the results you are expecting)
You have two options,
Option 1: reorganize your target worksheet so your lookup value is on the left, so you can use vlookup to pull columns to the right of it
Option 2, use a different kind of formula like a Match + index combination. (untested, but example below)
=Index(Races!$B$2:$B$20,match(Periods!A6,Races!$F$2:$F$20,0))

Related

Vlookup DragDown

Im beginning a new job in a fabric. Actually, for each product, they have a excel file with the product operations in different sheets. I saw that a real problem, it takes a lot of time, and every time we should have to change the layout of the order, we are going to need to change a lot of excel files.. It will take forever and I think I can help on that.
So, my idea, is making a sheet with all the products and their operations and formulas:
Then, I have maked another sheet with the order fabrication with all the operations needed to make the product:
Every product will have an ID and im using in all cells the vlookup function from the ID:
=IFERROR(VLOOKUP($K$3;'estrutura-artigos2'!B8:V71;5;FALSE);"")
And Its Ok like you see on the last image, the problem is when I change the ID it doenst change like it should be (on my head):
Can anyone help me on this problem? I want it to change always to the ID I insert, and dont continue with the new ID.
=IFERROR(INDEX(Sheet1!E:E;MATCH(1;($K$3=Sheet1!$A:$A)*(COUNTIF($A$6:$A6;Sheet1!$E:$E)=0);0));"")
As your examples show no columns or rows I made my own. Please modify the formula to your ranges. Sheet1 is your datasheet.
Column A in Sheet1 is the column holding the ID in your datasheet.
Column E in Sheet1 is the column holding the 'op' in your datasheet (between qty and machine column).
Counting starts at row 6 in my example, but modify it to the cell above where you put your formula.
Enter the formula with ctrl+shift+enter as it is an array formula.
Change the index for the different results, but keep the rest of the formula unchanged.
Updated answer based on the visibility in rows and columns:
In A13 use =IFERROR(INDEX(datasheet!F$8:F$72;MATCH(1;($K$3=datasheet!$B$8:$B$72)*(COUNTIF($A$12:$A12;datasheet!$F$8:$F$72)=0);0));"")
Match returns the row number of the first match where datasheet column B equals the value in $K$3 and where the values of datasheet column F don't equal any of the previous results of this formula in column A (above the current row number)
The result is the row number that needs shown from the indexed column.
For the issue im having, this is as far I already went thanks to #P.b:
The problem im having is that the formula Im using goes right no operation 20, instead going to the operation 1, any idea how to fix this?
Formula using on the A13 = =IFERROR(INDEX(datasheet!F:F;MATCH(1;($K$3=datasheet!$B:$B)*(COUNTIF(datasheet!$B$8:$B71;datasheet!$F:$F)=0);0));"")

Sum values in different rows if they match

I need some help regarding an issue that I was not able to solve. I tried to figure it out but without reaching my goal. This is what I have:
In sheet 1 I have estimated active customers for a period of time, where columns are months and rows are departments/states:
Sheet 1
Then, in sheet 2, I'm forecasting sales and need excel to return values from sheet 1 depending on which month we are kicking-off for each department:
Sheet 2
Of course, the kick-off month may vary for each department and values from sheet 1 should accommodate according to the selected month on column B in sheet 2.
And within C2:I4 I have used this formula:
=IFERROR(IF(C$1>=$B2,INDEX(Sheet1!$B$2:$F$4,MATCH($A2,Sheet1!$A$2:$A$4,0),MONTH(C$1)-MONTH($B2)+1),""),"")
The formula above actually works great when departments are not repeated in sheet 1 but, what would happen if departments are repeated (as shown in sheet 1) and I have to sum values from the same department and show the result on each cell in sheet 2?
I look forward to your kind help!
Thanks!
Try using SUMIF like this:
=IFERROR(IF(C$1>=$B2,SUMIF(Sheet1!$A$2:$A$4,$A2,INDEX(Sheet1!$B$2:$F$4,0,MONTH(C$1)-MONTH($B2)+1)),""),"")
Please try this formula, designed for your Sheet2!C2 cell.
=IFERROR(SUMIF(INDEX(Rodrigo,,1),$A2,INDEX(Rodrigo,,MONTH(C$1)-MONTH($B2)+1)),"")
In order for this formula to work you should declare a named range comprising of your range Sheet1!A2:F4. My formula calls the range Rodrigo. If you choose another name please change the name in the formula accordingly.
You can exclude zero results by adding a further IF condition to the formula. I would prefer to do that via cell formatting, like 0;0;; where the third semi-colon determines that a zero will not be shown. You can also suppress display of zeros for the entire sheet in the worksheet options.

Excel: Return Multiple Items with One Lookup Value but on a different sheet

My formula works, but only if its in the same page, and along the same rows
Formula:
=(INDEX($C$1:$D$4,SMALL(IF($C$1:$C$4=$F$2,ROW($C$1:$C$4)),COLUMNS(D1:D4)),2))
Note: Column G has the formula, what it does it look for value in F2 (which is 1.2) within the columns of C & D, and extracts the respective data in column D. So in this case, it would extract the data in column G.
Question: Now what do I do if I want this to occur from different sheets, or even different workbooks? I need to do this exact same thing, extract the data that is in column c and d (which is on a different workbook) to my workbook.
Every time I try, I get a value error.
Bonus: I'm also trying to get the date that is closest to today's date, I have this formula here:
=IF(COUNT(G2:G5)>0,INDEX(G2:G5,MATCH(MIN(ABS(G2:G5-$D10)),ABS(G2:G5-$D10),0)),"")
Where D10 is just equal to =TODAY() and this entire formula works by pressing ctrl+shift+enter
If you can also include this into the formula so that it just spits out the closest date in G2 rather than spit out all the dates. But it is not necessary, just helps a lot.
For your "Closest to today problem", I was trying to spread the difference of the date or a comparison of the date just like in your example. This is just not working out. I solved the problem by adding another column. I do not know if this is a valid option for you or not, but here is what I have. Assuming H is available or you can insert a new column H. use this dragged down for each row - in your exampl 2 thorugh 5.
=ABS(D$10-G2)
Then add this in H10 or wherever you see fit
=D10-(MIN(H2:H5))
Here is an excel-ish example
5/12/2014 =ABS(D$10-G2)
5/13/2015 =ABS(D$10-G3)
5/14/2014 =ABS(D$10-G4)
5/15/2014 =ABS(D$10-G5)
6/6/2016 =D10-(MIN(H2:H5))

Excel formula for earliest date ONLY when value a second column matches the value a third column

SOLVED - No further efforts required. Formula below.
I am trying to create a function that works across two worksheets to find the earliest date if it matches criteria in 2010. The goal is to continuously see the most out-of-date item that has the same "name", so that it can be reviewed and made current. The process repeats.
The first worksheet produces a summary for a product. The second is a collection of metadata for the product. I would like to find a function that compares a column to a single cell on the first worksheet and produces the earliest date from the rows on the second worksheet that match.
Here's the basic idea:
IMGUR LINK TO SCREENSHOT OF CONCEPT. Sorry. Doesn't seem to let me embed.
It is important that if a 4th AA is added, the formula finds it and continues to account for it.
I've tried some combinations of IF, VLOOKUP, and MINA or MIN, but can't seem to get it to work.
The closest I've gotten is
=MIN(IF(A11:A18=A3, C11:C18, broken).
But that doesn't seem to work when I raise the amount of values in the arrays.
Any help would be appreciated. Thank you.
SOLVED: Function was correct. I forgot to use "ctrl+shift+enter". Keeping post active for others to reference.
Try
=MIN(IF(A3=Sheet2!A:A,Sheet2!B:B)) entered as an array formula (Ctrl+Shift+Enter)...This formula assumes that your text criteria is in Column A of Sheet 2 and your date criteria is in Column B of Sheet two. This formula would be pasted in cell B3.

Concatenated VLookup comparison for conditional Formatting

I'm looking to create a conditional formatting field which will compare the values of two cells on sheet 2, to then format the correct cell on sheet 1.
To give some background, I have a spreadsheet (sheet1) which gets information from (sheet2). (sheet1) concatenates the Assessment period (B4) with the Subject code (AA12) and the Pupil ID (A15) which in turn is used to look up the corresponding field in sheet 2 to get the information.
=VLOOKUP(CONCATENATE($B$4,AA$12,$A15),sheet2!$F:$M,7,FALSE)
Here, Column F in (sheet2) holds the concatenated field names and column L holds the Grade, I.e A,B,C etc.
Column M in (sheet2) holds the numeric equivalent of that grade, i.e A = 1, B = 2 etc.
The rows in (sheet2) hold information on the target grade and the current performed grade, as picked up from the concat where the assessment period is either 'Target Grades' OR 'Autumn End of Term'.
What I am looking to do is to have the grade in my original cell in (sheet1) to have conditional formatting applied based on if the numeric equivalent of the end of term grades in (sheet2) is <, = or > the target grades.
Im not sure if this is possible and have found some other helpful posts such as this one;
Multi-column vlookup conditional formatting
But my issue is that I have 000's of records so would be very time consuming and data heavy to have a conditional format for each and every record such as proposed;
=IF(sheet2!M12<ODBC!M4,"RED",IF(sheet2!M12=ODBC!M4,"YELLOW",IF(sheet2!M12>ODBC!M4,"GREEN")))
What is needed is to incorporate the VLookup so that this can be calculated all at once and basically smash these two functions together;
=AA15 < vlookup(CONCATENATE($B$4,AA$12,$A15)ODBC!$F:$M,8,FALSE)
=(ODBC!$F:M,8,FALSE)<(ODBC!$F:M,8,FALSE)
Please see the below images FYR
Sheet1;
Sheet2;
I'm not even sure if this is possible and is well beyond the scope of my Excel experience so any help would be very appreciated!
EDIT
I have tried this Formulae for the Green colour;
=VLOOKUP(CONCATENATE($A$2,E$5,$A8),Sheet2!$F:M,8,FALSE)<VLOOKUP(CONCATENATE($B$4,G$5,$A8),Sheet2!$F:M,8,FALSE)
This works but for some reason, when applied to other sections with the same added but with a '>' or '=' for red or orange it seems to break and not format properly.
Any Ideas?
I Have fixed this!
After much looking around it seems as though I was on the right track with the EDITs formulae;
=VLOOKUP(CONCATENATE($A$2,E$12,$A1),ODBC!$F:$M,8,FALSE)>VLOOKUP(CONCATENATE($A$4,E$12,$A1),ODBC!$F:$M,8,FALSE)
After coming back to this after a few days, the formulae seemed to work and I was able to successfully spread across the whole sheet, saving me countless hours of individual formatting! Not sure why this was not working originally, it may have had something to do with my cell selection within the "Use a formula to decide which cells to format"!

Resources