Index Match Match query Excel 2013 - excel

Good day.
I am having some difficulties inserting an Index Match Match formula into Excel 2013, and I can't for the life of me work out where I have gone wrong.
I have a data table (as seen in the screenshot). On the left hand column I have a list of sites; across the top I have a list of weeks, with the table filled with sale predictions. I basically want to bring through the sales predictions For a specific named site and week in rows 22 and 23, and the formula I have is:
=IF(ISERROR(INDEX(B2:AO20,MATCH(B22,B3:B20,0),
MATCH(B23,C2:AO2,0))),0,INDEX(B2:AO20,MATCH(B22,B3:B20,0),MATCH(B23,C2:AO2,0)))
All the is being is returned is a 0 value; without the error handling, all it returns is a #N/A!.
Is anyone able to advise me or point me in the right direction at all please?
Screenshot is hopefully below
Screenshot

Perhaps protect this with an ISERROR statement, but otherwise this should work:
=vlookup(b22,$b$2:$ao$20,match(b23,$b$2:$ao$2),false)
Although instead of protection (or as well as) I'd make the site and week cells into validated lists

Related

How do I recieve the number of cells based off of three columns in Excel?

I'm not too sure how to word this problem so, I apologize for the vagueness. Here is what I am trying to do though:
I have a large Excel table with a ton of values, I however, only care about 3 columns. The three columns I have are "Project Name", "Active/Planned", and "Week of Month". Here is an example of some values I would have:
Project Name
Active/Planned
Week of Month
StoreProj
Active
2021-07 Jul-Wk1
SecProj
Planned
2021-07 Jul-Wk2
StoreProj
Active
2021-07 Jul-Wk1
Now, I have used a formula to get the number of projects based on a specific week month and avoiding duplicate values for the project name. The code I used returns an integer of the number of projects. Here is what I used:
=IFERROR(ROWS(UNIQUE(FILTER(Table[Project Name],Table[Week of Month]=2021-07 Jul-Wk1))), 0)
This works as intended. Now the issue I am running into is that I need to filter through these rows as I did previously, but now I need to include the "Active/Planned" column. So, I want to be able to see how many projects I have based off of the week of the month and return a number of projects (excluding duplicate names), but be able to filter through that integer output based off of the active/planned projects. So in a perfect scenario I can choose the week of month and if the project is "Active" or "Planned" and see the amount of projects I have.
This might be an easy fix so I apologize, I am just stumped, any help would be greatly appreciated. Thanks!
Work through that step by step, you've got the FILTER function which is giving data to the UNIQUE function, to the ROWS function, and then your IFERROR. However, the data about whether each line/row is 'Active' or 'planned' isn't passed out beyond the FILTER function, so can't be used by anything further on in the above sequence.
Boring theoretical advice out the way, try this;
=COUNT(IF(UNIQUE(FILTER( Table[[Project Name]:[Active/Planned]], Table[Week of Month] = "2021-07 Jul-wk1"))= "Active", 1))
Explanation:
FILTER(...) outputs records with the relevant date filter, however it outputs Table[[Project Name]:[Active/Planned]] - both columns, to ensure all relevant data is there.
UNIQUE(...) Then narrows that down to unique values, although by this stage I'm not 100% sure you need this.
IF(... = "Active", 1) then replaces the 'Active' outputs with 1s
COUNT() returns the number of cells in the above that contain a number (the 1s from the IF())
Yes, you can't use COUNTIF on arrays (and all except that last bullet point above are outputting arrays not single values) - and no, I didn't know that before attempting to answer this question, found it over at a different question!

Excel - If + Index Match + Offset -- VBA or something else?

I made a dummy version (fake names and extremely shortened) of the 2 spreadsheets I'm working with this spread sheets
Background:
I'm automating the data between Contracts and our Accounting Team's template. Note that neither of these spreadsheet's formats can budge so that why I'm stuck. It's a clunky process that I am trying to automate. The main source of data is the "Contracts" tab. Let's say out of the 300 subcontractors projects, in the week of 1/24/2019 my coworker approved 130 of the projects. The logic of what I am trying to accomplish:
In the Contracts tab, if Column R is "Yes"--
In the "Accounting Template" tab (the one with formulas) Column B, pull all the cells of Contracts!A of the vendors we are set to pay.
The same applies to Template! (a nickname for the path) Column M, pull the specific contract ID's of the approved Contract ID's from Contracts!C.
Note I intentionally showed that my fake Puppies program is NOT approved to get their payment, this will help demonstrate how to resolve my issue
My key issue is that the Accounting Template skips every 3 rows for the Project, and the Contracts row has Project day every single row. So, for Template!A5, I am pulling data from Contracts!A2, and Template!A8 I am pulling data from Contracts!A3, etc.
I was able to (sort of) make this work with an offset, row and index match:
=OFFSET(INDEX(Contracts!$C$2:$C$167,MATCH(ROWS(Contracts!$A$2:A17),Contracts!$AB$2:$AB$167,0)),-10,0)
See that negative -10? For each new 3rd row I am starting at template, I'm manually changing it to -10, -12, -14, etc etc. Not exactly sophisticated.
Looking at how offset and row work, it looks as though they heavily rely on the coordinates of cells in the Contracts workbook. However, I ideally am looking to do this:
=IF(Contracts!R2="Yes",OFFSET(INDEX(Contracts!$C$2:$C$167,MATCH(ROWS(Contracts!$A$2:A5),Contracts!$AB$2:$AB$167,0)),-2,0))
However, once I throw a conditional (IF) in the mix, that reorientating the rows of my offset match. Are there better formulas for what I am trying to accomplish? A VBA script that could accomplish this IF, INDEX, MATCH, OFFSET, ROW dream of mine? I'm not married to either of these formulas.
I've perused a few VBAs but nothing seems to have a conditional like IF as a component.
EDIT:
Per a request, adding screenshots. There's also a Google Sheet link:
Contracts tab, purposely hiding irrelevant columns:
Accounting Template Tab:
I'd do it with VBA, but this formula example might help you start. If your issue is basically turning horizontal data into vertical data and you have a fixed interval of 3 rows. You will need to adapt the formulae for your actual set up.
The formulas used are:
F1 and down =IF(MOD(ROW()-1,3)=0,INDEX($A$1:$A$3,(ROW()+2)/3),"")
G1 and down =INDEX($B$1:$D$3,CEILING(ROW(),3)/3,1+MOD(ROWS($G$1:G1)-1,3))
I'm sure there are better ways ...

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.

Sum up cells based on conditions

I appreciate this could be treated as a simple question. I have been trying to figure out where I'm going wrong as I'm sure it is something simple ... from the Strategy Exposures tab you can see that his strategies are either macro or tactical I have a table (below) and have been asked to to sum up the required exposure for Macro and for Tactical depending on what is there. I want to create two separate cells. One which adds up 'Macro', and the other which adds up 'tactical'.
Strategy ExposureDescription ExposureRequired (USD)
EUR_MACRO DAX INDEX 2,000,000
EUR_MACRO FTSE INDEX 4,000,000
EUR_MACRO CAC40 INDEX 1,100,000
EUR_MACRO S&P INDEX 10,000,000
JPY_MACRO NKY INDEX 4,000,000
JPY_MACRO S&P INDEX 34,000,000
USD_TACTICAL S&P INDEX 4,000,000
JPY_TACTICAL NKY INDEX 6,000,000
JPY_MACRO S&P INDEX 3,000,000
Currently, I have tried variations of: =SUMIF(B$3:B$11,"*MACRO*",D$3:D$11)
however this formula keeps giving an output of 0. Table ranges from (diagonally) B2 - D11.
So it turns out after all of this, the SumIF function was working okay when we created a new workbook with brand new data. This prompted me to close down the current sheet which I was having formula issues with, disable the macros and re-try. It worked a charm. I have never experienced this before however as #brucewayne suggested, their must've been some conflict based on one of the macros. Unsure what yet, will look into this and see if I can figure it out. If I do will post more. Hope this helps someone.

Excel 2010 index match - multiple criteria

I am new to using index/match, and I'm facing some trouble. I have two worksheets, one with table act and the other with table wa. act contains 7,199 rows; wa has 25,099 rows.
I am trying to match order number and date in order to pull a document number from wa onto act. The order numbers will be an exact match, but the date on act is slightly less than the date on wa.
My formula is:
=INDEX(WA[BillingDocumentNumber],(MATCH([#[Customer PO Number]],WA[PO],0)+MATCH([#[GL Posting Date]],WA[CostPostedOn],-1)))
Depending on how I sort the wa data, I have gotten the following results:
494 document numbers returned (sometimes correct; sometimes pulling from the cell in wa directly beneath the cell that should be returned) with the rest #N/A;
approximately 1400 document numbers (all incorrect, I think) with the remaining being either #N/A or #REF
Can anyone help me? I have no practical knowledge of VBA, but I am the resident Excel "expert" (seems funny to me) in my company, so I am the person who is faced with the task of solving this problem... I have combed the existing forums, but I haven't found any that seem to provide a (non-VBA) solution for my problem. Any ideas would be greatly appreciated!
Thank you for your time.
Here is my untested proposed solution:
{=CONCATENATE(IFERROR(IF(AND(WA[PO]=#[Customer PO Number],WA[CostPostedOn]>#[GL Posting Date]),WA[BillingDocumentNumber],""),""))}
Entered as an Array Formula using CTRL + SHIFT + ENTER.
This will return in one text string all results that match the PO number and in which the act date is older than the wa date. You can modify your second and add a third conditional in the AND to create date ranges (ie WA[CostPostedOn]>=#[GL Posting Date]+7 or WA[CostPostedOn]<=#[GL Posting Date]-7).
As you are using arrays though there might be some performance issues when you scale this to 7,000+ formulas. Sadly you can't do a VLOOKUP with 2 conditionals.
Hope this helps. Cheers,

Resources