1

What is the best/easiest way to search through data from two Excel tabs on the same spreadsheet. To see if the field is on another tab. For example, on tab 1 there is a list of fruit and vegetables. On the second tab, there is a list of just fruits but there are some left off the second tab. I need a code that searches tab 2 and lets me know which info is not on the second tab compared to what is on tab 1.

I have similar code I have created but the code is for SQL and I am not familiar with how this should look in excel -

SELECT Team, Collector_Name, TopParent_Reporting, TopParent_Reporting_Name, Period, [Year], 
CASE WHEN (SUM(Amount_Paid)) <> 0 THEN 
(SUM(Weight_Rcpt_Trans))/(SUM(Amount_Paid)) ELSE NULL END 
AS TTP FROM arrt.tblTimeToPay_Abbreviated_PeriodA AS TTP    
WHERE TopParent_Reporting_Name LIKE 'Green Fruit%'  
GROUP BY Team, Collector_Name, TopParent_Reporting, TopParent_Reporting_Name, Period, [Year]    
ORDER BY [Year] DESC, Period DESC, TopParent_Reporting 
Raystafarian
  • 21,583
  • 11
  • 60
  • 89
BFLEEZY3
  • 13
  • 2
  • Welcome to Super User. We are not a script writing service. We expect users to tell us what they have tried so far (including any scripts they are using) and where they're stuck so that we can help with specific problems. Questions that only ask for scripts are too broad and are likely to be [put on hold or closed](http://stackoverflow.com/help/closed-questions). Please read [How do I ask a good question?](http://superuser.com/help/how-to-ask). – DavidPostill Nov 02 '15 at 17:29
  • Thanks for that heads up. I have similar code I have created but the code is for SQL and I am not familiar with how this should look in excel. That is why I thought I was asking a "good" question – BFLEEZY3 Nov 02 '15 at 17:31
  • Start with this [Excel Diff: Easy Ways to Find (and Highlight) Data Set Differences](https://blog.udemy.com/excel-diff/) or this [How to compare two columns and find differences in excel](http://superuser.com/questions/289650/how-to-compare-two-columns-and-find-differences-in-excel). – DavidPostill Nov 02 '15 at 17:34
  • That SELECT stuff is irrelevant. Excel != SQL – DavidPostill Nov 02 '15 at 17:35

1 Answers1

1

No need for VBA.

If your list is on Sheet1 and you want to see what on Sheet1 is not on Sheet2 you can use this formula in column B of Sheet1 -

=IFERROR(MATCH(A1,Sheet2!$A$1:$A$10,0),"Not Found")

It will return the row number from sheet 2 if found, otherwise it will tell you what's not found.

Now, if you have your fruits and vegetables categorized, then it might make more sense to use VBA.

Raystafarian
  • 21,583
  • 11
  • 60
  • 89
  • Thanks, I looked at that link when DavidPostill referenced the link in his comment and it works great. I appreciate the assistance. – BFLEEZY3 Nov 02 '15 at 20:00