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

#### mxc668

##### New Member
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
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

#### dave3009

##### Well-known Member
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:

#### DonkeyOte

##### MrExcel MVP
answered - removed

Last edited:

#### mxc668

##### New Member
That works. Thanks a lot.

mxc668

#### GMorris

##### Board Regular
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!

Replies
6
Views
752
Replies
27
Views
653
Replies
3
Views
348
Replies
7
Views
267
Replies
10
Views
1K

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

### 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