not sure how can I describe my question, please help!

mxc668

New Member
Joined
Jun 12, 2008
Messages
5
If I had column A and column B, how could I write a formula in Column C to decide whether cell 1 in column B is also in Column A as well? If yes, return value 1 to Column C otherwise return value 0.

Column A Column B Column C
a b 0
d c 1
c a 1
e f 0
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Welcome to the board...

Countif should do that for you...

In C1
=IF(COUNTIF(A:A,B1)>0,1,0)

Fill down

Hope that helps
 
Upvote 0
In column C put and copy it down

=IF(COUNTIF(B:B, A1), 1, 0)

HTH


Dave


P.S. Welcome to the Board
 
Last edited:
Upvote 0
Also, I did this with an array formula in column C:
Code:
=IF(ISERROR(MATCH(B1:B4,A1:A4,0)),0,1)
Just another way of doing it!
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,479
Members
448,967
Latest member
visheshkotha

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