Using MATCH function as range in VLOOKUP function in Excel - excel

Main Problem statement : To retrieve multiple matches in excel.
I have 3 columns starting from AD to AF.AD has multiple matches.I need to retrieve AF values for matched AD value.
I searched on net and got the below formula.
=IFERROR(INDEX($B$3:$B$13,SMALL(IF(D$2=$A$3:$A$13,ROW($A$3:$A$13)- MIN(ROW($A$3:$A$13))+1,""), ROW()-2)),"")
But I am trying to implement my own solution.I am trying to use MATCH function as range in VLOOKUP function.Then change the range of MATCH function to retrieve 2nd match and so on.Continue this until there is no match found.
Here is what I tried which is giving an #NAME error.
=VLOOKUP(AD3,AD&EVAL("=MATCH(AD3,AD:AD,0)"):AF1000,3,0)
Also,it would be very appreciated if there is another solution to the main problem statement.
If this is the right direction to proceed,please help to complete this formula.
Thanks.

Main Problem statement : To retrieve multiple matches in excel.
Now I have to get multiple matches and compare them if they are equal.
You seem to have an XY Problem. You are concentrating on resolving the first half of your formula problem while ignoring a simpler solution that would resolve the entire task.
=and(countif(ad:ad, ad3)=countifs(ad:ad, ad3, af:af, af3))
True if all related values in column AF where column AD is equal to AD3 are the same; false if column AF contains differing values.

Related

Why does my wildcard search with SUMIF not work?

In MS Excel, I'm trying to make a wildcard search using the SUMIF function. I'm following this guide. However, for some reason my Excel doesn't think the words in the range are equal to the criterion.
Suppose I have the following data:
I have apple as a criterion and want to find sum all the cells adjacent to one containing the word apple. My formula is:
=sumif(A2:A6, "*apple*", B2:B6)
Now, for some reason the result of the sum function amounts to nothing.
I also tried another test, which I think my error has to do with. If I type = "apple" = "*apple*", Excel returns False`. The two are related, I think, but I don't see how I can solve my original problem.
Any help is much appreciated.
Try
=sumif(b2:b6,"*apple*",a2:a6)
As according to your example you have the sum range first followed by the range you are controlling against.
That is the wrong way round for sumif().

Index/Sumproduct with 3 criteria

I am trying to lookup a value from another table based on a reference table.
See below my data sample:
SHEET 1 ("CalculationLiability"):
SHEET 2 ("KeyMetrics"):
In sheet 1, cell G7 I am trying to look up the value from Sheet 2 based on 3 criteria (supplier unique ID, type and season) I tried the following formula, but it is returning a #REF error.
=INDEX(KeyMetrics!$F$6:$AS$100,
SUMPRODUCT((KeyMetrics!$D$6:$D$39=CalculationLiability!$D7)*
(KeyMetrics!$E$6:$E$39=CalculationLiability!$G$6)*
(KeyMetrics!$F$5:$AS$5=CalculationLiability!$E7)))
Anyone knows what I am doing wrong here? I can get it to work for two criteria, but for three criteria it doesn't work. Any help or push into the right direction is much appreciated!
The Index uses a multi column, multi row reference. That means that you need two additional arguments, one argument for row, and another for column.
Your formula currently only provides one additional argument. When you step through the formula with the Evaluate Formula tool you can see that in the last step.
You can use an Index with two Match functions. The first one to find the row, the second one to find the column.
=INDEX(KeyMetrics!$F$6:$AS$100,
MATCH($D7&$G$6,INDEX(KeyMetrics!$D$6:$D$100&KeyMetrics!$E$6:$E$100,0),0),
MATCH(CalculationLiability!E7,KeyMetrics!$F$5:$AS$5))
You can also use Sumproduct, but in that case, don't use Index.
=SUMPRODUCT(KeyMetrics!$F$6:$AS$39,
(KeyMetrics!$D$6:$D$39=CalculationLiability!$D7)*
(KeyMetrics!$E$6:$E$39=CalculationLiability!$G$6)*
(KeyMetrics!$F$5:$AS$5=CalculationLiability!$E7))

Workaround for named range Search function issue in Excel

I have a bank export of Credit card vendors. As these vary, I use unique strings contained in each to identify them. For example here is a lookup table excerpt.
First Lookup
I then apply a formula =INDEX(First_level,MATCH(TRUE,ISNUMBER(SEARCH(Keywords,C3374)),0)) to produce this:
First calc
I found this formula here https://exceljet.net/formula/get-first-match-cell-contains
Then I reapply the formula to the result ie the First_Level using this formula =INDEX(Second_Level,MATCH(TRUE,ISNUMBER(SEARCH(Frst_Lev_Check,H44)),0)) with this Lookup.
Second Lookup
Most of the time it works, but for this I get the following
Second calc, where the first level classification is correct, but the second level one is completely wrong.
When I've gone into the depths of the formula, the issue is that the Search function is returning the wrong value.
This appears to be a known issue: https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-use-named-range-in-search-function/14c8c989-bed0-48f9-bce0-c0894571b557
Ideas welcome on workarounds/how to solve the problem.
Cheers Jon
Would you consider:
=MATCH("Apple",List)
and
=MATCH("Pear",List)
to return 1 and 2 respectively.
A couple of things in regards to your question:
The correct syntax for search is =SEARCH(find_text,within_text), so the correct formula would be =SEARCH("Pear",List).
The reason why you are getting the #Value is, because you are applying search to a range, but the function is only intended for cells.
The best ways to see if a value exists in a range are the countif and match function:
The countif function shows you how many times the a value is in a range:
The match function shows you in which row the the first value is:

Excel Formula Vlookup the value by referring Row and Column

In the sheet1 i have a table called working days of the countries as shown in the below image.
In the Sheet2 i have 10 columns in that based on the country and month by referring the this table i am trying to populate the values, When i tried doing by Vlookup the first row alone getting populated, but in the second row the header from F1:T1 is getting changed to F2:T2 so rest of the cells showing as #NA.
Anyone can you please give a solution for my issue. Here is the formula i have used.
=VLOOKUP(I1,Sheet1!F2:T7,MATCH(Sheet2!M1,Sheet1!F1:T1,0))
Thanks in Advance.
You are missing the symbol $ to lock the ranges, and the false condition to match exact values in the VLOOKUP.
It should be like:
=VLOOKUP(I1,Sheet1!$F$2:$T$7,MATCH(M1,Sheet1!$F$1:$T$1,0),0)
Or instead of VLOOKUP use HLOOKUP like:
=HLOOKUP(M1,Sheet1!$F$1:$T$7,MATCH(I1,Sheet1!$F$2:$F$7,0),0)
In general, combining the INDEX and MATCH functions is a superior option to VLOOKUP. For example, =INDEX(Sheet1!F:F,MATCH(Sheet2!M1,Sheet1!F1:T1,0)). This allows you to go left-to-right or right-to-left as well.
Snip for Index Match functions Using Vlookup won't work here because in the 2nd table you are repeating the country, unlike the first table. Use a combination of index match function, this is little trickier than the vlookup but it will fulfill your requirements.
Since I don't have the exact table you shared so I created a table on my end and sharing the snip here.

How to use wildcard in Cubevalue formula in Excel?

I am trying to get the values with wildcard in Cubevalue formula(below) in excel. I am not finding any solution.
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]","[Dashboard_Data].[Level_1].[Karnataka_India]")
I am trying to get the values where [level 1] ends with [_India], I don't want to create a calculated Column in Data Model as this condition may be used for different columns and different conditions.
I have also tried by giving cell reference(eg-[Cell A1] = "_India) as like below but I am not able to get the results.
CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]","[Dashboard_Data].[Level_1].["&A$1&"]")
kindly help me to overcome this issue.
First create a =CUBESET function in cell A1.
=CUBESET("ThisWorkbookDataModel","Filter([Dashboard_Data].[Level_1].[Level_1].Members, Right([Dashboard_Data].[Level_1].CurrentMember.Name, 6)=""_India"")")
Basically that is a language called MDX and the expression before "" double quote escaping is:
Filter([Dashboard_Data].[Level_1].[Level_1].Members, Right([Dashboard_Data].[Level_1].CurrentMember.Name, 6)="_India")
Then reference it in your =CUBEVALUE formula:
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sum of Bookings_Net]",$A$1)

Resources