Compare cells in two sheets

geobruin

New Member
Joined
Apr 20, 2009
Messages
7
Hello.

I have two sheets (sheet1 and sheet2). I have data values in column A of both sheets. I need to look through the values in column A of sheet 1 and return a "y" in column B of sheet 2 if the value in column A of sheet 2 can be found. I have tried to illustrate this below:

ABAB

1 1y
2 2y
3 3y
4 5
6 6y

I suppose I will be using "countif" but I don't know how to specify "if exists in column A of sheet 1" as the condition.

Thank you in advance.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi,

Try this in B1 of Sheet2
=IF(COUNTIF(Sheet1!$A$1:$A$200,A1), "Y","")
copy down

You can increase the range $A$1:$A$200 if necessary

HTH

M.
 
Last edited:
Upvote 0
Hi there,

Try the following formula, just change the ranges to suit:

=IF(ISERROR(VLOOKUP(A2,Sheet1!A2:A30,1,FALSE)),A2,VLOOKUP(A2,Sheet1!A2:A30,1,FALSE)&"y")

HTH

Robert
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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