If match then put a 1 next to it (?)

San Antonio Heat

Active Member
Joined
Oct 10, 2003
Messages
322
I have two worksheets, page 1 has names in them. So A1 has nothing and b1 has Dallas in it.

In sheet 2, if I put Dallas anywhere in the A column, I want cell A1 on sheet 1 to show a 1 since it matches on sheet 2. Is this possible?
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

San Antonio Heat

Active Member
Joined
Oct 10, 2003
Messages
322
Only problem is if I use match and get 1 for True, how do I get rid of the #N/A if they do not match?

=MATCH(B2,Sheet2!A1:A29)

If they don't match I get a #N/A, I really need that to read 0
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Only problem is if I use match and get 1 for True, how do I get rid of the #N/A if they do not match?

=MATCH(B2,Sheet2!A1:A29)

If they don't match I get a #N/A, I really need that to read 0

Only problem is if I use match and get 1 for True, how do I get rid of the #N/A if they do not match?

=MATCH(B2,Sheet2!A1:A29)

If they don't match I get a #N/A, I really need that to read 0

=MATCH(B2,Sheet2!A1:A29)

would mean that A1:A29 is sorted in ascending order. If so, you shouldn't get #N/A, unless B2 < Sheet2!A1.

If sorted...

=IF(B2 < Sheet2!$A$1, 0, (LOOKUP(B2,Sheet2!$A$1:$A$29)=B2)+0)

If not sorted:

=ISNUMBER(MATCH(B2,Sheet2!$A$1:$A$29,0))+0
 

Watch MrExcel Video

Forum statistics

Threads
1,122,224
Messages
5,594,912
Members
413,952
Latest member
JGer

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
Top