I am trying to look up the master codes in the "List" sheet and put the results into column D in the "Master" sheet. The criteria are that Category and Event need to match Primary Catergory and Event_Name in the "List" sheet.
Thank you.
I am trying to look up the master codes in the "List" sheet and put the results into column D in the "Master" sheet. The criteria are that Category and Event need to match Primary Catergory and Event_Name in the "List" sheet.
Thank you.
This in D2 on the master sheet should work for you:
![]()
=INDEX(List!$A$1:$A$623,MATCH(1,INDEX((List!$B$1:$B$623=Master!A2)*(List!$C$1:$C$623=Master!B2),0),0))
Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.
<---Click * Add Reputation for all helpful comments. It's like giving a smile.
Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.
Give this formula a try.
=IF(SUMPRODUCT(--(List!$B$1:$B$623=Master!A2),--(List!$C$1:$C$623=Master!B2),List!$A$1:$A$623)=0, "",SUMPRODUCT(--(List!$B$1:$B$623=Master!A2),--(List!$C$1:$C$623=Master!B2),List!$A$1:$A$623))
enter
=INDEX(List!A:A,MATCH(A2&B2,List!B:B&List!C:C,0))
as an array formula
Using Control + Shift + enter
to get
{=INDEX(List!A:A,MATCH(A2&B2,List!B:B&List!C:C,0))}
you can change the A:A and B:B and C:C to an actual range you are likely to use - that would be better
Wayne
if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here
If you have a solution to your thread - Please mark your thread solved do the following: >
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
I can do the N/A ones manually I guess
There are many errors between the worksheets. These errors result in #N/A.
<---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.Ron W
I nwould always go for the formula suggested by nigelbloomy. But. None of the above have pointed out the fact that many errorsare returned, because the phrases dont match exactly.
Order Denying Application For Legal And Administrative Fees And Expenses in master B5, is not the same as
Order Denying Application For Legal, Administrative Fees And Expenses in List C47.
You'll have to iron out those inconsistencies, first, before this will work.
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU
The first index creates a list of all of the values in column A on the List sheet. Now it just needs to someone to tell it which row number to pick.![]()
=INDEX(List!$A$1:$A$623,MATCH(1,INDEX((List!$B$1:$B$623=Master!A2)*(List!$C$1:$C$623=Master!B2),0),0))
Match will find the first row number that matches the value of 1 from a list of values.
The next index creates that list of values for match to pick from. First it takes all of the values in column B and tells you True or False if they are equal to the value in A2. Then it finds all of the values in column C and tells you true or false if they match the value in B2. Then it multiplies these two results together. If they are both true, it shows up as True, if either one or both are false, then it turns into false. The cool part if that true is the same as 1 and false is the same as 0. So match will find the first time a row number is true for both criteria and give that row number back to the first Index list.
Now the first index knows which row to tell you, and it gives you the master code that matches.
The formula that I used was an ARRAY formula which is entered with Ctrl + Shift + Enter.
Formula:
=INDEX(List!$A$3:$A$621,MATCH(Master!A2&Master!B2,List!$B$3:$B$621&List!$C$3:$C$621,0))
The INDEX part of the formula is in simple terms the data that you want to find. The INDEX function actually returns the value found at the intersection of a row and column. INDEX(List!$a$3:$a$621 indicates the column from which we want to retrieve data.
The MATCH part of the formula is going to give the row from which to retrieve data. Seeing that the criteria is actually two parts (Master column A and Master column B) the two parts are combined with the & which concatenates or joins the cells referenced together to be treated as if it was 1 unit. MATCH(Master!A2&Master!B2 is what we are actually going to search the List worksheet for in columns B and C. ,List!$B$3:$B$621&List!$C$3:$C$621 are the columns B and C on the List worksheet that have been "joined" with the & sign and this will allow both columns to be treated as a single column for the formula. So, now we have the two criteria joined and an array of two columns that have been joined in which the search for the criteria will take place. The next element in the formula is 0. 0 is the same as FALSE. This means that we want an exact match. When a match of the criteria is found in the array, the value in the INDEX column on the same row is returned.
The same results can be obtained by using helper columns on both the Master and List worksheets that combine the criteria and the array columns. On the Master worksheet the helper column would have =A2&B2 entered in the helper column (column E)an filled down, and the List worksheet would have in column D =B2:C2 and filled down.
The formula to retrieve the data would then be =INDEX(List!$A$3:$A$621,MATCH(E2,List!$D$3:$D$621,0)) filled down.
There are non-array formulae to extract the data. nigelbloomy supplied one:
=INDEX(List!$A$1:$A$623,MATCH(1,INDEX((List!$B$1:$B$623=Master!A2)*(List!$C$1:$C$623=Master!B2),0),0))
This formula starts off the same as the Array formula with the INDEX which serves the same purpose.
The MATCH part is different. Here the MATCH value is 1 which seems strange but next part will make use of that 1. The ARRAY part of the MATCH function is being dealt with by the INDEX function containing the multiplication of the two columns on the list worksheet that were joined together in the array formula above. This multiplication produces a series of 1s and 0s. The 1s are matches and the 0s are non matches. So MATCH is actually matching 1 with 1 in the calculated array.
I hope that this satisfies your query.
Great work!! and great explanations! this was hardcore. . .I am trying to understand this I will be in touch if I have any other questions.
Thanks!![]()
An array formula will return values that would not normally be returned in a single cell like series of cells being calculated against other series of cells. If not entered with Ctrl + Shift + Enter the formula would not be an array formula an error or an inappropriate value that would be returned.
NOTE:
Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
Thanks again for the explanation! and yes I agree it makes it more ambiguous what we are talking about if I just select the entire quote.
I am marking the thread as solved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks