cross reference between 2 sheets in same workbook

cjacinto

New Member
Joined
Feb 16, 2018
Messages
1
I work with audit rules that are being populated from a financial database (Concur) into an excel sheet. There are different rules being applied to different organizations.

I need to compare the overall data in sheet2 that has the names of the codes for the organization that are auto populated from Concur, to the list of audit rules in sheet1 (named AFP).

On sheet 2 I want to compare column A named "Name" and compare AFP column A with the "New Rule Title". I need to make sure that sheet 2 with the auto populated AFP auditing rules are not missing any other rules AFP should have from the AFP sheet.

(NOTE) I do have multiple organizations in these sheets and have filtered to AFP titles only.

How would I do this?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
If I understand this correctly, you have two sheets, and you want to make sure that none of the entries in spreadsheet 1, column A, are missing in spreadsheet 2, column A?

You can do this with VLOOKUP. As the name indicates, VLOOKUP will "look up" a value from sheet 1 and see if it exists in sheet 2. If it does, the function returns the value. If it doesn't, the function returns #N/A.

Important: Sheet 2 must be sorted by the column you're looking up.

Put the VLOOKUP in the first empty column to the right of your data in sheet 1.

VLOOKUP has these arguments:
The value you are looking for (lookup_value)
The range of cells that make up the table (table_array)
The number of the column from which to retrieve a result (column_index)
The match mode (range_lookup, TRUE = approximate, FALSE = exact)

The lookup value, of course, is the value in sheet 1 you're going to lookup in sheet 2.
The table array is just the range you're going to search in sheet 2. You don't have to include the whole range. You can include just column A.
The column index is 1. The reason you can give different columns numbers is so you can search for something in one column, and return what's in a different column of the same row (for example, in a different application, you might search for a part number and return the part's price).
The match mode is FALSE because you want an exact match. This is why you have to sort sheet 2. Otherwise, VLOOKUP would give up as soon as the value in the search column was greater than the value you're searching for.

If you were looking for Charlie in this column, VLOOKUP would say no Charlie upon coming across David, because David is ahead of Charlie in the sort order.
Alice
Bob
David
Charlie
Ernie
Frank
George

Anyway, copy the VLOOKUP all the way down, and the cells with #N/A are the ones that are missing in sheet 2.

By the way, the table array argument will be an absolute range (e.g. $A$1:$A$50) because you're searching through the same range every time. If you don't make the range absolute, the search range will shift down every row.

You are now probably more confused than before, so here are a couple of links on VLOOKUP.
https://spreadsheeto.com/vlookup/
https://exceljet.net/things-you-should-know-about-vlookup
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,619
Members
449,039
Latest member
Mbone Mathonsi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top