Multiple Match Excel [duplicate] - excel

This question already has answers here:
Vlookup using 2 columns to reference another
(2 answers)
Closed 7 months ago.
My goal is to Match the Primary Key's of two different sheets in Excel. In this scenario, the primary key has multiple duplicates, but is differentiated with column TYPE.
What would be the way for me to Match the Primary Key to the correct key with only TYPE = 'A'?
=INDEX('SHEET 1'!C:C,MATCH(A2,'SHEET 1'!A:A))
This code is matching the primary key to both sheets to obtain name, however I do not know how to specify/match the TYPE = 'A' as well>
Image 1 with the code
Image 2Reference Data

Make a helper column in sheet1
with formula =A2&B2
It will give "x1A" "X1B"....
then use this formula:
=INDEX(Sheet1!C:C,MATCH(A2&"A",Sheet1!E:E,0))
observe there is a Zero in the end of the Match function.
If someone knows how to do this without helper column, I would be thankful to see that solution.

Related

Cumulated Products (Multiplications) of Array in Excel [duplicate]

This question already has answers here:
Excel Dynamic Array formula to create a running product of a column
(3 answers)
Closed 5 months ago.
I would like to obtain the cumulated products of an array, also calculated through an array formula.
What that means is, assuming I have an array of numeric values, I want to do a row-wise multiplication of all values up to that row. The following screenshot might clarify the task:
I was trying to do it as follows, where the range of 'rates' in the screenshot above is named 'Rates'. I split the vector of n values into an n-times-n matrix where each column includes one more value than the previous one:
Here using the formula:
=(ROW(Rates)<TRANSPOSE(ROW(Rates))+1)*Rates
And then I would have to take the product of each column (value > 0 condition) through an array formula, but I didn't find a way to that yet.
Notes:
I'm using Office 365 (x64), but BYCOL() and BYROW() are not available to me.
All values of the 'rates' vector are strictly positive.
I'm trying to avoid VBA to keep the file in .xlsx format since it is often removed from emails otherwise.
I want to use the table as a template where the 'rates' vector would come in various sizes in the future, hence a dynamic array solution would be best.
I'd appreciate your input.
With SCAN:
=SCAN(1,Rates,LAMBDA(κ,λ,κ*λ))
Without some of the newer O365 functions, a non-volatile solution might not be straightforward. A volatile option would be:
=SUBTOTAL(6,OFFSET(INDEX(Rates,1),,,SEQUENCE(ROWS(Rates))))

how to get names of matching value in excel from ID [duplicate]

This question already has answers here:
Why can't VLOOKUP function right-to-left?
(1 answer)
Not able to apply Vlookup in Excel for elements on left side of foreign key.
(3 answers)
Vlookup limitations- want to transfer backwards
(1 answer)
Excel Formula for Inventory
(1 answer)
Closed 11 months ago.
I am trying to match value from different sheet to another sheet to get match value as per ID but when ever writing formula it does not give correct results
So Sheet 1
Name ID
Test 1
Test2 2
And Sheet 2
ID Name
2
1
2
so like to match ID column from sheet 1 and populate name in Sheet2
I tried using vlookup but not working not sure is it the right way to write as am new to excel
=VLOOKUP(B5,Sheet2!$B$5:$C$104,2,0)
I had also encountered a similar problem before but i do not remember the solution. You can take the help of these subreddit as it is a similar problem.
Link- https://www.reddit.com/r/excel/comments/jvyovz/comment/gcmz4mq/?utm_source=share&utm_medium=web2x&context=3
If this is the correct solution, happy to help.

im using INDEX and MATCH with excel to return a value i want but can i make it so in the match it has to match two sets of data instead one set? [duplicate]

This question already has answers here:
Vlookup using 2 columns to reference another
(2 answers)
Closed 3 years ago.
I get the idea of how to use Index and Match ;-
=INDEX(Sheet1!C:C,MATCH(Sheet1!B:B,Sheet2!B:B,0))
The issue I'm facing is that, Sheet 1 and Sheet 2 have data pulled from different sources (but has the same headings).
I want to try to use the above Index and Match to bring back data that is compared to two different sets of data.
Both Sheet will have the following heading lets say ;-
The data I want pulled back is data from "Size", I can use the above formula for "Firstname" and "Surname", but data will be different, so i want to use this to find the differences, I don't mind the values returning as N/A as that will work for me in this task, but can I do it in one formula ?
Sheet1 :-
Sheet2 :-
From the above image, you can see the dataset is mixed up and if it was real data i would use in the workplace, the data in Fristname could be different format, such "MPS1_"
Thanks
In C2 on Sheet2 put:
=SUMIFS(Sheet1!C:C,Sheet1!A:A,A2,Sheet1!B:B,B2)
And copy down

Using Excel formulas to find a substring in cells when condition is met [duplicate]

This question already has answers here:
Count if two criteria match - EXCEL formula
(2 answers)
Closed 5 years ago.
I want to search for a given sub-string in column D when conditions are met in columns A and B.
A simple countifs as suggested in the question Count if two criteria match - EXCEL formula does not match because I would like the ingredient (Chocolate in my example) to be part of the values and not an exact match like in that question. It is therefore NOT a duplicate question.
Let's say I own a restaurant (I wish :) and I have this:
Column A: the category of a dish
Column B: the price range of the dish
Column C: the name of a dish
Column D: a list of ingredients in that dish
I want to search if any of the main course that is expensive contains chocolate (i.e. putting in a cell the value FALSE, "No" or 0). It could look like something like that
I don't want to do this by using VBA but rather using Excel Formulas.
Really appreciate your help.
Thanks
[NOTE]:
The difference with the suggested related question is to add * in the matched strings. Although a small difference, it is what made me ask the question in the first place.
CountIfS is your friend here
=COUNTIFS(A:A,"Main",B:B,"Expensive",D:D,"*chocolate*")>0
Enter into E2:
=AND(A2="Main",B2="Expensive",IFERROR(SEARCH("Chocolate",D2)>=0,FALSE))
And drag down.

Array as criteria in Excels COUNTIFS function, mixing AND and OR [duplicate]

This question already has answers here:
Countif With Multiple OR Criteria
(4 answers)
Closed 8 years ago.
I have been googling this for a while and can´t seem to get it to work. I use Excel 2010 and want to count rows on a mix of AND and OR operators.
What I want to do is something like this
COUNTIFS($A:$A,"string1" , $B:$B,"string2" , $C:$C,{"stringA","stringB","stringC"})
This means mixing both AND and OR operator in the COUNTIFS function. Col A and col B must match the string criteria but col C must only match one of the values in the array given as criteria. Match on colA AND colB AND on one array value in col C.
A different approach would be to create one COUNTIFS function for each value in the array like
COUNTIFS($A:$A,"string1" , $B:$B,"string2" , $C:$C,"stringA") + COUNTIFS($A:$A,"string1" , $B:$B,"string2" , $C:$C,"stringB") + COUNTIFS($A:$A,"string1" , $B:$B,"string2" , $C:$C,"stringC")
This however is a lot of duplicate code and that bugs me! The logic solution would be to pass an array as criteria for column C. Also my array contains more then three values...
When I do this in Excel the formula is accepted and a few rows are counted but the results are way to low. It is not the result I´m expecting.
Any Excel-Pro out there that can tell me if this is possible? It would save me a lot of work!
Thanks!
you can use
=SUM(COUNTIFS($A:$A,"string1",$B:$B,"string2",$C:$C,{"stringA","stringB","stringC"}))
you can also use a similar array construction with sumproduct
=SUMPRODUCT(($A:$A="string1")*($B:$B="string2")*($C:$C={"stringA","stringB,"stringC"}))
Hmm, well, 'or' does make things longer. See a related question. I guess you could use =SUMPRODUCT() but still have it a bit long. Being an array function though, you'll have to use Ctrl + Shift + Enter.
=SUMPRODUCT(($A:$A="string1")+0,($B:$B="string2")+0,((($C:$C="stringA")+($C:$C="stringB")+($C:$C="stringC"))>0)+0)
Disclaimer: I haven't tested this yet.

Resources