Can't seem to figure this out.
I have two Excel sheets, A and B.
Sheet A has a column full of MLS IDs, call this column M and Sheet B has a column full of MLS IDs call this column N.
I would like to search Sheet A for the values from column N in the second sheet and where there is a match I would like to add a column O.
I have tried using VLOOKUP but afraid my formula doesn't work too well, and the extension .
Any help is appreciated.
If vlookup is failing, I would investigate using the index match method instead - it's very well documented online, and sidesteps most of the failings of lookups very nicely and efficiently. This link might help: http://www.mbaexcel.com/excel/why-index-match-is-better-than-vlookup/
There's a breakdown of how to use VLOOKUP here:
How to combine two excels that have a common column (but aren't in the same order)
A few common issues:
- Make sure the exact search string is actually in the search range (no leading whitespace, etc.)
- The search range needs to be anchored or it will drift and you will lose results
- the 4th argument (exact match) should be FALSE or you might get weird behavior
Related
First, thank you for the help in solving this problem. It's pretty simple but I'm just not getting it.
In excel, I have 2 tabs. In the first tab, I have rows of personel data (job title, country of business, Industry, etc.)
In the second tab, I have a column of prohibited titles. These are titles that don't match the criteria we want.
I'd like to create a formula that checks the rows in tab 1 against the prohibited titles in tab 2. If the data matches, I'd like it to return 'N' in column A, which signals that we should remove that row of data. Title information is found in row F on tab 1.
My various countif functions aren't working and I'm not sure why.
Various countif formulas, like
=COUNTIF(F:F,"'Bad Titles!'A:A")
Produces N for all titles we want to disregard
Use MATCH it is quicker:
=IF(ISNUMBER(MATCH(F2,'Bad Titles!'A:A,0)),"N","")
If the matches are partial then:
=IF(SUMPRODUCT(--ISNUMBER(SEARCH('Bad Titles!'$A$1:$A$100,F2))),"N","")
I have a problem that seems pretty easy, but still cannot find a proper solution, I want to avoid using vba.
I have two tables in one spreadsheet. both have the same columns - Name, City, Province.
My goal is compare both and if three out of three values in a row match, then pull "1", if not, pull 0.
I have used the formulas below , but it does not work for my case .
=IF(AND(A2=P:P,G2=M:M,H2=L:L),1,0)
=INDEX(A:P,MATCH(A2,P:P,FALSE),MATCH(G2,M:M,FALSE),2)
=INDEX(L:P,MATCH(A5,P:P,0),MATCH(G5,M:M,0),MATCH(H5,L:L,0))
=SUMPRODUCT(--(L2:L60=H2),--(M2:M60=G2),--(P2:P60=A2),B2:B60)
It seems that the solution is quiet simple , but I cannot find it,
Thanks in advance!
The key here is to merge the columns together, them Match on that.
Like this
=IFERROR( IF( MATCH(H3&"_"&I3&"_"&J3, $C$2:$C$60&"_"&$B$2:$B$60&"_"&$A$2:$A$60,0), "Yes"), "No")
Choose a seperator character that doesn't otherwise appear in your data (I've chosne _)
Assumption: Values just need to exist, not that they need to be of equivalent row.
=If(IfError(Match(A2,P:P,0),0)*IfError(Match(G2,M:M,0),0)*IfError(Match(H2,L:L,0),0)>0,1,0)
For each IfError, you will output a row number (>0) if you match, or if there is no match a zero will be output. Multiply anything by zero and you get zero, whcih allows a 1 or 0 output for true/false in the overarching If-statement.
If they need to be of the same row, you can compare 2 matches, which rely on the transitive property (A=B, B=C, so A=C):
=If(And(Match(A2,P:P,0)=Match(G2,M:M,0),Match(G2,M:M,0)=Match(H2,L:L,0)),1,0)
Edit1:
Per my comment (to this answer) about false negatives, a UDF or subroutine in VBA would be more appropriate, considering Match() returns the first row that has a match.
As this is not a VBA tagged post, this is a bit above the expected answer... My recommendation would be to:
A) Ensure you are comfortable using VBA.
B) Make a post about creating a user-defined function (note that any post on here about VBA has an expectation that the poster can interact with an expert on the topic and will be putting forth effort to write the code themselves, as StackOverflow is not a code-for-you service).
To help give a lead on what may be in your UDF:
A loop to go through the values from first row to last row in the search column (i.e., L, M, & P)
A variable to dynamically identify the last row of your search column
An if-statement to compare values from your lookup values (i.e., A2, G2, H2) to the search values at the current iteration of the loop
An output of 1 (has match) or 0 (no match).
There are many ways to go about this with VBA; hopefully that's a good start for you, Irina!
Trying to put an advanced filter on an imported data list and copy to new sheet.
It only seems to either show everything in results or nothing except headers. I'm sure this is to do with my criteria, but I have tried every permutation I can think of (short of using VBA as I'm not competent with it), but nothing seems to yield actionable results.
If someone could have a look at the screenshots below and provide some direction I'd be most grateful.
The headers for the criteria are directly copied from the table headers and I've tried by separating the OR formulas into descending cells in the same column. Maybe it's to do with the syntax of the formulas I'm using, but I was informed by multiple sources online to have a formula that always returns a Boolean result and to have it tied to the first data in the worksheet that I want sorted (hence the B2, K2, O2, etc.).
Teylyn:
I was using this format for the criteria before, but it gave the same results - nothing at all!
criteria 2
Just tried again with the above criteria and no results again.
Additionally have tried with the following criteria - same again.
criteria 3
I need it to filter for every permutation of criteria columns 1, 2 & 3, hence the OR formulas being used before - I thought it might be filtering for AND all first row criteria, OR, AND all second row criteria.
I've even gone so far as to format all criteria such that it searches for first column (B2<=TODAY()-3) AND 2nd column AND 3rd column (O2="Not booked") then underneath, to imply OR, 1st column (B2<=TODAY()-3) AND 2nd column AND 3rd column (O2="Sent"). Setting out each permutation in this tiresome fashion. Still no results.
I can send you a dropbox link to the file if it will help.
You are not using Advanced filter correctly. It does not work with formulas like the ones you enter. You put one condition per cell, not a formula with OR().
Take a look at the documentation:
https://support.office.com/en-us/article/filter-by-using-advanced-criteria-4c9222fe-8529-4cd7-a898-3f16abdff32b#bkmk_5
or here:
https://www.techrepublic.com/blog/microsoft-office/how-to-use-and-and-or-operators-with-excels-advanced-filter/
I am trying to create code that will help me achieve the correct format. All I want is to pull employee (EE) entire row and paste into a new sheet, and then second part (ER) value to match the same employee.
In other words, if employee pay pension contributions for 100 (Pen EE (Tal)) and employer pay for 200 (Pen ERS (Tal)) on behalf of the same employee. Then, the worksheet should look like Column A= Pers No, Column B=Employee Name, Column C= ID Number, Column D=PenPay, Column E=Pens EE(Tal) and Column F=Pens ER(Tal) and G= Total (Pen EE +Pen ER values), as exactly in example tab.
I hope this makes sense. I have tried several methods but no luck so far. Thank you all for your help.
From your problem description, I think I can decipher that you are using Excel.
I see three basic approaches to solving your problem:
The simplest approach is not to use VBA at all and instead use the workbook functions INDEX and MATCH. The latter returns the row or column where an exact match is found in the search range, which has to be one dimensional. (The exact match actually requires the search option 0.) The function INDEX returns the value at the given row and column in a range. Combining both, you get a more flexible verision of VLOOKUP and HLOOKUP, which you can use to find the values in the second table for a given employee. (MATCH returns an N/A error if no match is found.)
The second approach is to use the Excel object model in VBA. You can search a range for a value using the Find method of the range. This returns the cell where the match is found and Nothing in case there is no match. If the search result is not Nothing, you can use the EntireRow property to get the entire row and the Cells property to select cells in the row.
Finally, you can use the support of SQL for Excel via ADODB. For a description how to do this, you can look at this Microsoft page and this old question on SO. Provided you know how to write SQL queries, this should enable you to solve your problem via SQL.
I have a list of alphanumeric inventory items in Column A. They are sorted ascending by value.
In Column B, I have an unsorted list of the inventory items filenames.
I'd like to place a formula in Column C that finds the cell in Column B that contains a substring that matches Column A.
I've experimented with several forms of VLOOKUP and INDEX/MATCH, but the best I've gotten is an index number of the matching cell. That isn't quite what I need, but its the closest I've gotten.
I'd really like to get the entire value of the cell in Column B.
I know of one way to do this, and one additional resource that might make your life much easier.
First, If I had the index of the matching cell, I would simply use an indirect function. They're used like this:
indirect("string reference to a cell")
In your case, cell C1 would contain
=indirect("A" & B1)
Second, the resource I have in mind is something I read long, long ago, but stuck in my mind as absolutely brilliant. It uses the lookup function, which only exists for backwards compatibility but has turned out to have hidden utility. See this MrExcel.com page for more info. Barry Houdini's answer is, to prevent link rot, repeated here without the question itself: =LOOKUP(2^15,SEARCH(D$2:D$10,A2),E$2:E$10)