Excel index match formula with large if paramaters - excel

Im wondering if someone can help insert an OR option into the below formula
=INDEX(B2:B211,MATCH(LARGE(IF(C2:C211=HomeTeam,B2:B211,""),1),B2:B211,0))
Ive tried the below but unfortunately this brings back an incorrect result
=INDEX(B2:B211,MATCH(LARGE(IF(OR(C2:C211=HomeTeam,D2:D211=HomeTeam),B2:B211,""),1),B2:B211,0))
Any help is appreciated

Short answer is to use + rather than OR - the OR function returns a single value not an array as required here, so it doesn't work as expected in array formulas
Try like this
=INDEX(B2:B211,MATCH(LARGE(IF((C2:C211=HomeTeam)+(D2:D211=HomeTeam),B2:B211),1),B2:B211,0))
I'm assuming that HomeTeam is a named range (hence no quotes) - is that a single value?
As you are returning the value itself here you don't really need INDEX and MATCH in any case, you can use just
=LARGE(IF((C2:C211=HomeTeam)+(D2:D211=HomeTeam),B2:B211),1)

Related

Lookup / Vlookup not returning correct value

Either I use Lookup or Vlookup, the result is wrong if my lookup value is from a formula.
It is correct if I type the lookup value. I'm expecting 5 as result, which I was able to get in first row because I typed '80%'. However in second row, I get 4 when I reference it to the computed 80%:
But I need to have it look up via a formula, any help please?
While rounding solved the problem for you, it didn't explain where the problem started.
Judging by your examples matching the correct values when typed and wrong if calculated, I conclude the values in A1:B6 are not percentages, but text strings. Using round on those solves your problem, since round converts the string to a number (if it can).
See explanation in this screenshot:

Finding a value from array in File Path [Excel]

I have a little problem with Excel.
I'm trying to compare if one of several specific words occur in a path.
This is what I do with the following function:
=IF(ISERROR(SEARCH($C$2:$C$4,A2)),"NO","YES")
However, the result is always "No".
Example data:
Does anyone have an idea?
SEARCH($C$2:$C$4,A2)
will return an array of a number or a #VALUE! errors.
If you wrap that in ISNUMBER it will return an array of TRUE;FALSE...
To see if ANY of the values are TRUE, wrap that in an OR and use that in your IF statement.
Of course, since this is an array formula, you have to enter it by holding down ctrl + shift while hitting Enter
=IF(OR(ISNUMBER(SEARCH($C$2:$C$4,A2))),"Yes","No")
You can see what is happening by using the Formula Evaluation tool
You can use SUMPRODUCT with ISNUMBER and SEARCH
=IF(SUMPRODUCT(--ISNUMBER(SEARCH(C2:C4,A2)))>0,"YES","NO")

Using SUMPRODUCT and OFFSET on multiple rows in Excel

I have a question on using OFFSET in Excel.
For instance, I have a table with values varying by years.
Then, I have a table with some values varying by year/months.
!!Click here for the tables!!
I would like to write a formula e.g.
=SUMPRODUCT((E2:E37)*OFFSET(A1,C2:C37,1),E2:E37)
but it returns #VALUE!
In short, I would like to use an array of values in C2:C37 i.e. {1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3} to obtain the array {0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,}, and this array is then used in the SUMPRODUCT function.
Can someone help me solve the #VALUE! issue?
Thanks in advance!
Apparently (I didn't know this) Offset is unusual because it can return a set of range objects when used with an array as the second argument. Most functions can't handle this if you pass it to them. But if you put it through the N function, you get the right answer.
=SUMPRODUCT((E2:E37)*N(OFFSET(A1,C2:C37,1)))
or
=SUMPRODUCT((E2:E37),N(OFFSET(A1,C2:C37,1)))
Note that these appear to give an array of #Value! errors when you run them through Evaluate Formula but these resolve after passing through the N function.
Of course it would be more common to do this the easy way and use Index or Vlookup with a helper column. My first thought when trying to do it in a single Array formula without using Offset was this:-
=SUM(E2:E37*MMULT(N(C2:C37=TRANSPOSE((ROW(A2:A4)-1))),B2:B4))
I would think that the Offset way is easier and more efficient.
But in this particular case where there are only a small number of categories you could use this array formula which is perhaps the simplest approach:-
=SUM(CHOOSE(C2:C37+1,0,B2,B3,B4)*E2:E37)
The above formulae only work for the special case where the 'key' is the same as the row number in the lookup column. The offset method can easily be adapted to incorporate a lookup:-
=SUM((E2:E37)*N(OFFSET(A1,IFERROR(MATCH(C2:C37,A2:A4,0),0),1)))
See this reference

SUMIF for a wider range

I have a problem that has been nagging me for a while now. I am a novice in Excel. Hence excuse me if this comes across as silly.
I have the following array of data:
I need to obtain the sum of values corresponding to the row entry "book".
I have used the formula sumif(B4:F7,"book",C4:F7). However excel returns the value in column c alone (i.e value returned is 10).
Update
I ammended my formula as follows:
I now obtained the correct sum - i.e 70. However, I deal with large volumes of data and using this formula is not efficient. Can anyone suggest a quick workaround for this?
Your guess is correct. There is a simpler way, but it is not easy to find it out for a novice user. You will need to use an array formula to do what you need.
Type this formula:
=SUM(IF($B4:$B7="book",$C$4:$F$7,0))
and enter it using Ctrl + Shift + Enter instead of just Enter
You can see the result in this picture (my delimiter is ; while yours will be ,, but that does not make a difference):

Reference of a coloumn from a 2D Array Excel

Good day, I have googled the life out of this and I am sure it is so simple. I am trying to find the reference in coloumn A (which are letters) after a 2D lookup in a table of random numbers. The 2D lookup is working fine but I have tried many formula's to get the reference letter in the first coloumn to no avail. ANY help would be greatly appreciated. Tried to re-create the table as I can't upload pics.
My formula is =VLOOKUP(E34,B4:M29,MATCH(E32,B2:M2))
I have built another formula =INDEX(A2:M29,MATCH(H34,B4:B29,0),MATCH(H32,B2:M2,0)) which I thought would work but returns the wrong value. I think I have to nest a INDEX in a INDEX?
Really not sure - please HELP!
As far as I understand Your question: the formula is working well but if you use a comma as the last parameter then it will find the Exact match. as you said your reference contains letters so the last parameter (just a comma) is not necessary here. Any way i have tried to draw a figure as you explained. And the Reference you are trying to get: it is not got by a formula, once you have supplied the reference then you can get the reference values using a Data Validation List option and choose correct letters. More over for which column do you want to retrieve the value for your reference? for this you can again use Data Validation List for Column Numbers (Names etc). The formula I used is: =VLOOKUP(E34,B4:M29,MATCH(E32,B2:M2),) in E36.
If this answer is not enough, then you should explain your question again in detail. Thanks.

Resources