How to use INDEX / MATCH together? - excel-formula

Hello i'm wanting to remove the sheet '01' and point at AH1 which has my sheet name in.
I seem to have got the first part of the formula right for the array. But no matter what i try i cannot seem to get the other 2 working.
This is for a forecasting file that works week on week
Current Code
=INDEX(INDIRECT("'"&AH$1&"'!$1:$1048576"),MATCH([#SKU],'01'!$D:$D,0),MATCH(AJ$4,'01'!$4:$4,0))

It needs to be similar to the first:
=INDEX(INDIRECT("'"&AH$1&"'!$1:$1048576"),MATCH([#SKU],INDIRECT("'"&AH$1&"'!$D:$D),0),MATCH(AJ$4,INDIRECT("'"&AH$1&"'!$4:$4),0))

Related

Index with double Match returns incorrect closest values

I have an planning exported to Excel which looks like the following (tab ' Data'):
Each production line has a number of people working on it. Now is my goal to show how many people are working on a line per minute. We plan per product group, and several product groups combined form waht a line has to do per minute.
To get the production per minute I created the following (tab 'Conversie'):
=INDEX(Data!$H$2:$H$157;MATCH($N$1&A4;Data!$B$2:$B$157&Data!$C$2:$C$157;1))
In the example it works correct. However, the formula doesn't seem to always return the correct "Artikelomschrijving"(H) every time. I get incorrect return values when I extend this formula to other product groups.
I read that the data needs to be sorted ascending cause I use match_type 1. When I do that I get the right returns for some product groups, but the given example suddenly returns incorrect values.
I can't sort both column C and A in ascending order for the formulas to always return correct items. Can you help me to get past this hurdle?
After a little bit of google translate work, if I'm understanding your question correctly, you need to find the "Item Description" (H) of the record where the "Line" (B) = the value in N1 and the time is between the start and end times.
This is an array formula, you have to confirm it with Ctrl+Shift+Enter
=INDEX(Data!$H$2:$H$157,MATCH(1,(Data!$B$2:$B$157=$N$1)*(Data!$C$2:$C$157<$A2)*(Data!$D$2:$D$157>=$A2),0))
OR with semicolon syntax:
=INDEX(Data!$H$2:$H$157;MATCH(1;(Data!$B$2:$B$157=$N$1)*(Data!$C$2:$C$157<$A2)*(Data!$D$2:$D$157>=$A2);0))
I found the solution, thank you for pointing me in the right direction Valon Miller. This is the formula I fixed it with:
=ALS.FOUT(INDEX(Data!$H$2:$H$154;MATCH(1;(Conversie!L$1=Data!$B$2:$B$154)*((Conversie!$A32>=Data!$C$2:$C$154)*(Conversie!$A32<=Data!$D$2:$D$154));0));"")

Looking for a value through iserror and vlookup through worksheets

I am trying to loop through several worksheets to detect a value. This value will exist on many of the worksheets but I want to find the earliest one. Each tab contains weekly data. The first week will contain the data for the first time. Next weeks will include the data of previous weeks. My goal is to find when a user was first reported. I have tried different VBA code with for loops and match and index functions but no luck.
I decided to use the following function:
=IF(ISERROR(VLOOKUP(A3,DataExtract.xlsx!Table1[#Data],1,FALSE)),"","6/11/2017")
This line of code works perfectly and completes the task but is only able to search through 1 of the 24 worksheets.
I tried running multiple times of this command but with no luck
=IF(ISERROR(VLOOKUP(A2,DataExtract.xlsx!Table1[#Data],1,FALSE)),"","6/11/2017"),
IF(ISERROR(VLOOKUP(A2,DataExtract.xlsx!Table2[#Data],1,FALSE)),"","13/11/2017"),
IF(ISERROR(VLOOKUP(A2,DataExtract.xlsx!Table3[#Data],1,FALSE)),"","20/11/2017")
each different table contains the data of each week stored in the different worksheets.
Can this code be modified to work correctly or my only chance is to continue search for a macro to do my task? Any help would be really appreciated.
thanks to the help from the users who have commented on this post I have managed to solve my issue.
The following code is the one I needed. It uses the second if function as the false part of the first expression when the value it searches for is not found in the first table which is located in a different workbook.
=IF(NOT(ISERROR(VLOOKUP(F2,DataExtract.xlsx!Table1[Email Address],1,FALSE))),"6/11/2017",
IF(NOT(ISERROR(VLOOKUP(F2,DataExtract.xlsx!Table2[Email Address],1,FALSE))),"13/11/2017","Not There"))

Excel match multiple records from timetable

I just stuck with my school homework, it seems easy, but there is always different errors and mistakes.
Context
All I need is to connect information from 3 pages.
The first one is timetable of trainings.
The second page is "groups"
Players page
Question
1) Here is my first question. How I can put the time from the "timetable" page ?
I tried vlookup with the easiest group "children 5-7" but even this doesnt work.
The problem is that there is many possible times of some groups and I need the answer like "17:00, 18:00 etc" then.
2) The second question is with the page "players".
Firstly I need to match group or coach from page "groups". For children all is simple, but excel dont want to work even with this. But, there is one problem more. In adult group there cant be more than 4 players in one group, that why I have TK1, TK2, TK3 and TK4 - all this are for adult A. and TK11, TK22 etc are for adult B. So when its done we should match court and time from page "groups".
There is my spreadsheet so be free to try it right here. Hope you will help me!
Ref
https://docs.google.com/spreadsheets/d/1PNp60xmHOx_Q1wBc33WrzIaWmeNG5UMhi-4roV7dJXU/edit#gid=1868650910
I try to give you some ideas about how to solve your issues
Question 1:
The issue you have with VLOOKUP is that you cannot search on the left of your lookup value in the reference table. As suggested above by BruceWayne, you may use INDEX/MATCH. Considering the structure of your data a good formula could be:
=INDEX('timetable try here'!B:G,MATCH(A2,CHOOSE(B2,'timetable try here'!C:C,'timetable try here'!D:D,'timetable try here'!E:E,'timetable try here'!F:F,'timetable try here'!G:G),0),1)
In fact I am using CHOOSE() to select the column where your case should match, because your courts are numbers from 1 to 5. You may replace this formula in the column D under the label Time in your sheet named "groups try here". By the way the result that you get is only the first occurrence (in case you see a zero with some decimals figures, remind to change format to hours), so you will not be able to get the list as you like. As far as I know Excel does not have such kind of formulas. What you could do is create a VBA formula by yourself. You can find more details in this other post always here in StackOverflow, where I replied to a similar question with some code. I believe that your case is exactly the same.
Question 2
In this part I just added the last argument to the VLOOKUP and your formula works. So the correct formula should be in cell E2 of "players try here":
=VLOOKUP(D2,'groups dont try here'!A2:C15,3,0)
and in cell F2 (Court) of the same sheet:
=VLOOKUP(D2,'groups dont try here'!A2:C15,2,0)
I believe you need also a formula to pick-up the time in cell G2 (time):
=VLOOKUP(D2,'groups dont try here'!A2:D15,4,0)
These formulas of course works with suitable groups starting with "children". For the others it is not very clear to me what you need. If you have grouped all TK in Adult A and Adult B you need to have some criteria to fill in the other cells from your sheet 'groups dont try here'. Also remind that if you recode the TK1 and TK2 (for instance by adding a new column to be used as key for the VLOOKUP), with VLOOKUP you will always pick up only the first occurrence in the table.
If you need more support, please leave a comment.

Excel - How to combine these formulas into one?

I have this worksheet which lists results oldest to newest dates.
I have these three formulas..
=IFERROR(LARGE(IF([#HomeTeam]=[HomeTeam],IF("H"=[FTR],IF([Date]<[#Date],IF([#Season]=[Season],[Date],"")))),1),"NULL")
=IFERROR(LARGE(IF([#HomeTeam]=[AwayTeam],IF("A"=[FTR],IF([Date]<[#Date],IF([#Season]=[Season],[Date],"")))),1),"NULL")
=IF(AND([#[SLWD_H1]]="NULL",[#[SLWD_H2]]="NULL"),"NULL",MAX(Results[#[SLWD_H1]:[SLWD_H2]]))
Basically the first looks for the last time the home team won a game at home.
The second looks for the last time the home team won a game away from home.
And then the third gives me the latest date of the two mentioned above.
I was wondering if there was a way to combine all three into a single column instead of having to have three?
Thankyou in advance.
**EDIT
To make myself a bit clearer! What I want is to combine the above 3 into one formula which will output the result!
So it will find the date in example 1 and find the date in example 2 and then it will output the latest date.
Use the MAX formula to determine the highest date between the home and away dates.
The formula would look like this:
=MAX(Number1,Number2)
The MAX formula will ignore the NULL text values. However if both values are NULL, it will return a zero value. If formatted as a date it will show as 00/01/1900
=MAX(IFERROR(LARGE(IF([#HomeTeam]=[HomeTeam],IF("H"=[FTR],IF([Date]<[#Date],IF([#Season]=[Season],[Date],"")))),1),"NULL"),IFERROR(LARGE(IF([#HomeTeam]=[AwayTeam],IF("A"=[FTR],IF([Date]<[#Date],IF([#Season]=[Season],[Date],"")))),1),"NULL"))
If I understand correctly, would an OR("A"=[FTR],"H"=[FTR]) work? This would work like your first formula except using both "A" and "H" games.
=IFERROR(LARGE(IF([#HomeTeam]=[AwayTeam],IF(OR("A"=[FTR],"H"=[FTR]),IF([Date]<[#Date],IF([#Season]=[Season],[Date],"")))),1),"NULL")
Are these the only two values for [FTR]? If so you could just get rid of that IF statement entirely requiring either H or A:
=IFERROR(LARGE(IF([#HomeTeam]=[AwayTeam],IF([Date]<[#Date],IF([#Season]=[Season],[Date],""))),1),"NULL")

Excel small mistake in function

I'm having a small problem with my formula in excel. I got a long list with IDs from different people numbered from 1 to 20535 for which I want to calculate the portfolio return. One ID has multiple lines so the ID is repeated over multiple lines depending on their number of investments.
This is the formula (it's working perfectly except for the bold)
=IF(B3=1;SUMIF($B$2:$B$357553;V3;$D$2:$D$357553);B4=B3+1)+IF(B3=1;SUMIF($G$2:$G$187396;V3;$I$2:$I$187396);B4=B3+1)+IF(B3=1;SUMIF($M$2:$M$544950;V3;$O$2:$O$544950);B4=B3+1)+IF(B3=1;SUMIF($R$2:$R$131523;V3;$T$2:$T$131523);B4=B3+1)
The only mistake is the part in bold. Once I get to the second person (so the second ID) it stops as the condition is not met anymore. How can I make it run past the first person? So untill ID 20535.
Thanks in advance!
Since you just want the TRUE part of the IF each time, just remove the IF and use the SUMIFs:
=SUMIF($B$2:$B$357553;V2;$D$2:$D$357553)+SUMIF($G$2:$G$187396;V2;$I$2:$I$187396‌​)+SUMIF($M$2:$M$544950;V2;$O$2:$O$544950)+SUMIF($R$2:$R$131523;V2;$T$2:$T$131523)‌​
Put the above in row 2 and copy down. That should do it.

Resources