# Can LooKUP get return value of True or False?

1. ## Can LooKUP get return value of True or False?

Hi there,

I want to check a value to see if it is in an array. If it is in the
array then return true, else return false. I use LookUP function but it
does not work. Here is my table

A B C D
1 1 6 1
2 1 3 1
3 1 1 1

I want to check values in column C in Column A. If it is in {1,2,3}
then return 1 in Column D at the corresponding row. But the cell with 6
there also return 1. Any way to correct it?
Thanks.

lc  Register To Reply

2. ## Re: Can LooKUP get return value of True or False?

In D2 enter:
=IF(ISNA(VLOOKUP(C2,\$A\$2:\$A\$100,1,0)),0,1)
Then copy down as required.
This will return 1 if the value is found in column A and 0 if it is not
found.

Hope this helps
Rowan

lvcha.gouqizi wrote:
> Hi there,
>
> I want to check a value to see if it is in an array. If it is in the
> array then return true, else return false. I use LookUP function but it
> does not work. Here is my table
>
> A B C D
> 1 1 6 1
> 2 1 3 1
> 3 1 1 1
>
> I want to check values in column C in Column A. If it is in {1,2,3}
> then return 1 in Column D at the corresponding row. But the cell with 6
> there also return 1. Any way to correct it?
> Thanks.
>
> lc
>  Register To Reply

3. ## RE: Can LooKUP get return value of True or False?

This should do...

In Cell D1 =COUNTIF(\$A\$1:\$A\$3, C1)>0
In Cell B1 =COUNTIF(\$C\$1:\$C\$3,A1)>0
--
HTH...

Jim Thomlinson

"lvcha.gouqizi" wrote:

> Hi there,
>
> I want to check a value to see if it is in an array. If it is in the
> array then return true, else return false. I use LookUP function but it
> does not work. Here is my table
>
> A B C D
> 1 1 6 1
> 2 1 3 1
> 3 1 1 1
>
> I want to check values in column C in Column A. If it is in {1,2,3}
> then return 1 in Column D at the corresponding row. But the cell with 6
> there also return 1. Any way to correct it?
> Thanks.
>
> lc
>
>  Register To Reply