return 1 if value found in list

MICMERG

New Member
Joined
Apr 19, 2011
Messages
4
Hi,

I have a long single column list and need to see if a value appears in the list.

So, if my list goes from A1 to A999 and I am looking to see if number 51 (value of cell D43) appears in list. If number 51 is there, return 1 if not, return 0

Thx
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi,

I have a long single column list and need to see if a value appears in the list.

So, if my list goes from A1 to A999 and I am looking to see if number 51 appears in list. If number 51 is there, return 1 if not, return 0

Thx

Either...

=ISNUMBER(MATCH(51,$A$1:$A$999,0))+0

Or...

=ISNUMBER(MATCH(E1,$A$1:$A$999,0))+0

where E1 houses a value like 51.
 
Upvote 0
Hi,

I have a long single column list and need to see if a value appears in the list.

So, if my list goes from A1 to A999 and I am looking to see if number 51 (value of cell D43) appears in list. If number 51 is there, return 1 if not, return 0

Thx
Try this...

=--(COUNTIF(A1:A999,D43)>0)
 
Upvote 0
Aladin

Don't know why but works great when values in array go from 1-20 but if I change from 21-49 I get all 1s
 
Upvote 0
You are correct - My bad.

Even works when looking for 2 values on another sheet: =--AND((COUNTIF(RESULTATS!$C$5:$V$5;$C$1)>0);(COUNTIF(RESULTATS!$C$5:$V$5;B3)>0))

Guess that's what 20 hrs of Excel and Access will do to you.

Thx for the help.
 
Upvote 0
You are correct - My bad.

Even works when looking for 2 values on another sheet: =--AND((COUNTIF(RESULTATS!$C$5:$V$5;$C$1)>0);(COUNTIF(RESULTATS!$C$5:$V$5;B3)>0))

Guess that's what 20 hrs of Excel and Access will do to you.

Thx for the help.
You're welcome. Thanks for the feedback! :cool:
 
Upvote 0
aladin akyurek said:
either...

=isnumber(match(51,$a$1:$a$999,0))+0

or...

=isnumber(match(e1,$a$1:$a$999,0))+0

where e1 houses a value like 51.
=count(match(51,a$1:a$999,0))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

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