Find same numbers on first sheets column a in the second Sheet column a, if found, put a "Y" in column c on first sheet

midiyuga

New Member
Joined
Oct 8, 2004
Messages
31
Office Version
  1. 2019
  2. 2013
  3. 2007
Platform
  1. MacOS
help. find same numbers on first sheets column a in the second Sheet column a, if found, put a "Y" in column c on first sheet

Thanks so much!
 

Attachments

  • Screenshot 2024-08-20 at 3.58.11 PM.png
    Screenshot 2024-08-20 at 3.58.11 PM.png
    203.4 KB · Views: 4

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try this:
2024-08-20.xlsx
ABC
1NO SOCIONOMBREOn Sheet2
21879670Juan y Enedina Marroquin 
3909504Israel y Maria Govea 
43868009Carlos y Esther Hernandez 
5834317Sergio y Olga Alvarez 
61890500Mayolo y Wendy RubioY
72123045Aristeo Martinez 
83018496Mario Perez 
92325225Eloisa Alcantar 
101905702Arturo Martinez 
114900219Luis y Esther AguilarY
123872883Jose y Angelica Aleman 
134553624Sotero y Reyna Arzate 
143399685Martin e Idalid Perez 
151748145Alberto y Cruz AvilaY
165690679Eusebio y Laurentina Leal 
17215168Samuel y Azalia Castaneda 
185189133Manuel y Angelica Castro 
19199784Jesus y Josefina Cervantes 
20982906Carlos y Ofelina Chalico 
214971390Elvira H. Contreras 
223122140Maynor y Linda Del CidY
234203207Delfino y Elpidia Duran 
244938885Helio y Alicia Gonzalez 
254602904Oscar y Perla Gonzalez 
266497945Antonio y Sara Hernandez 
272769101Martin y Norma IbarraY
284562584Jose y Gloria Mendez 
Sheet1
Cell Formulas
RangeFormula
C2:C28C2=IF(COUNTIF(Sheet2!$A:$A,Sheet1!A2),"Y","")

2024-08-20.xlsx
A
1NO SOCIO
24900219
31890500
41748145
53122140
62769101
Sheet2
 
Upvote 0
Solution
It works! thanks so much! will it be much to ask to put a "N" (on sheet 1 column c) when a specific number is not found on both sheets?
 
Upvote 0
It works! thanks so much! will it be much to ask to put a "N" (on sheet 1 column c) when a specific number is not found on both sheets?
You just need to change the false condition to "N" like so:
Excel Formula:
=IF(COUNTIF(Sheet2!$A:$A,Sheet1!A2),"Y","N")
 
Upvote 0
I would strongly suggest that you alter those formulas by removing the sheet name 'Sheet1' from them. It is a bad idea to use the sheet name of the sheet the formula is on in a formula on that sheet.
To demonstrate, below I have the post #4 formula in column C and the very same formula in column D but with the Sheet1 name reference removed. Both formulas correctly identify the items that are on sheet 2 (which I have manually coloured green.

Sample2.xlsm
ABCD
1NO SOCIONOMBREOn Sheet2On Sheet2
21879670Juan y Enedina MarroquinNN
3909504Israel y Maria GoveaNN
43868009Carlos y Esther HernandezNN
5834317Sergio y Olga AlvarezNN
61890500Mayolo y Wendy RubioYY
72123045Aristeo MartinezNN
83018496Mario PerezNN
92325225Eloisa AlcantarNN
101905702Arturo MartinezNN
114900219Luis y Esther AguilarYY
123872883Jose y Angelica AlemanNN
134553624Sotero y Reyna ArzateNN
143399685Martin e Idalid PerezNN
151748145Alberto y Cruz AvilaYY
165690679Eusebio y Laurentina LealNN
17215168Samuel y Azalia CastanedaNN
185189133Manuel y Angelica CastroNN
19199784Jesus y Josefina CervantesNN
20982906Carlos y Ofelina ChalicoNN
214971390Elvira H. ContrerasNN
223122140Maynor y Linda Del CidYY
234203207Delfino y Elpidia DuranNN
244938885Helio y Alicia GonzalezNN
254602904Oscar y Perla GonzalezNN
266497945Antonio y Sara HernandezNN
272769101Martin y Norma IbarraYY
284562584Jose y Gloria MendezNN
Sheet1
Cell Formulas
RangeFormula
C2:C28C2=IF(COUNTIF(Sheet2!$A:$A,Sheet1!A2),"Y","N")
D2:D28D2=IF(COUNTIF(Sheet2!$A:$A,A2),"Y","N")


Now suppose that I now decide that I want this data sorted by the values in column A, so I do that by selecting A1:D28 and then using the Sort option on the Data ribbon tab. The result is below.
You can see that the column C formula now shows 4 of the 5 rows that are on Sheet2 incorrectly with an "N" (red) and another 4 rows that are not on Sheet2 incorrectly with a "Y" (orange).
The column D formula still shows the correct results.

Sample2.xlsm
ABCD
1NO SOCIONOMBREOn Sheet2On Sheet2
2199784Jesus y Josefina CervantesNN
3215168Samuel y Azalia CastanedaNN
4834317Sergio y Olga AlvarezNN
5909504Israel y Maria GoveaNN
6982906Carlos y Ofelina ChalicoNN
71748145Alberto y Cruz AvilaYY
81879670Juan y Enedina MarroquinNN
91890500Mayolo y Wendy RubioNY
101905702Arturo MartinezNN
112123045Aristeo MartinezYN
122325225Eloisa AlcantarYN
132769101Martin y Norma IbarraNY
143018496Mario PerezNN
153122140Maynor y Linda Del CidNY
163399685Martin e Idalid PerezNN
173868009Carlos y Esther HernandezNN
183872883Jose y Angelica AlemanNN
194203207Delfino y Elpidia DuranYN
204553624Sotero y Reyna ArzateYN
214562584Jose y Gloria MendezNN
224602904Oscar y Perla GonzalezNN
234900219Luis y Esther AguilarNY
244938885Helio y Alicia GonzalezNN
254971390Elvira H. ContrerasNN
265189133Manuel y Angelica CastroNN
275690679Eusebio y Laurentina LealNN
286497945Antonio y Sara HernandezNN
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,950
Messages
6,175,582
Members
452,653
Latest member
craigje92

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