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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
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

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,128
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Mobile
  3. Web
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

GMorris

Board Regular
Joined
Aug 17, 2007
Messages
114
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,190,796
Messages
5,982,971
Members
439,810
Latest member
phobo3s

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