ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparing worksheets (https://www.excelbanter.com/excel-worksheet-functions/144504-comparing-worksheets.html)

enna49

Comparing worksheets
 
HI
This answer is probably somewhere in this forum, maybe not wording it
correctly.
What I have is 2 worksheets with names and various different information on
each.
eg
Sheet 1
Name CreditCard
Sheet 2
Name Address etc

What I want to do is compare the worksheets and if the name is on both
sheets to put a credit card in a new cell on sheet 2.
Thanking you


OssieMac

Comparing worksheets
 
You could use Vlookup function.
The following example assumes 'Name' is in column A and the credit card in
in column B of sheet 1. The formula is in cell B2 of sheet 2.
=VLOOKUP(A2,Sheet1!$A$2:$B$101,2,FALSE)

A2 is the name on sheet 2

The data to look up is in array $A$2:$B$101. Note the $ signs for absolute
mode.

A match for A2 must be found in the first column of the lookup array.

The 2 means to insert the data from the 2nd column of the lookup array.

False means to get exact match not near match.

See help on Vlookup for more info.

#N/A will appear if match is not found.

Note the lookup array can be any number of columns so long as the data being
looked up is in the first column. The data to be inserted can be in any
column.

Regards,

OssieMac




"enna49" wrote:

HI
This answer is probably somewhere in this forum, maybe not wording it
correctly.
What I have is 2 worksheets with names and various different information on
each.
eg
Sheet 1
Name CreditCard
Sheet 2
Name Address etc

What I want to do is compare the worksheets and if the name is on both
sheets to put a credit card in a new cell on sheet 2.
Thanking you


enna49

Comparing worksheets
 
Thankyou,



"OssieMac" wrote:

You could use Vlookup function.
The following example assumes 'Name' is in column A and the credit card in
in column B of sheet 1. The formula is in cell B2 of sheet 2.
=VLOOKUP(A2,Sheet1!$A$2:$B$101,2,FALSE)

A2 is the name on sheet 2

The data to look up is in array $A$2:$B$101. Note the $ signs for absolute
mode.

A match for A2 must be found in the first column of the lookup array.

The 2 means to insert the data from the 2nd column of the lookup array.

False means to get exact match not near match.

See help on Vlookup for more info.

#N/A will appear if match is not found.

Note the lookup array can be any number of columns so long as the data being
looked up is in the first column. The data to be inserted can be in any
column.

Regards,

OssieMac




"enna49" wrote:

HI
This answer is probably somewhere in this forum, maybe not wording it
correctly.
What I have is 2 worksheets with names and various different information on
each.
eg
Sheet 1
Name CreditCard
Sheet 2
Name Address etc

What I want to do is compare the worksheets and if the name is on both
sheets to put a credit card in a new cell on sheet 2.
Thanking you



All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com