Formula for return a "1" if certain numbers are found

cl604

New Member
Joined
Nov 29, 2013
Messages
31
Hi guys

I am using Excel 2011.

I am trying to make a formula that will return a 1 if certain numbers like 26, 52, 35 etc up to 20 different ones are found in Column Ac1 down to Ac500. If no numbers are found then it just says 0.

I tried this formula but it does not do multiples IF(ISNA(VLOOKUP(26,$AC$5:$AC$15,0,FALSE)),"1","0")
I am thinking now that this formula is not the way to go.

thoughts?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try =SIGN(SUMPRODUCT(COUNTIF(AC1:AC500, {26, 52, 35, 134})))

The explicit array can be replaced with a cell vector containing the numbers of interest.
 
Upvote 0
Any ideas how i can reverse this so if A certain number is found IE 26,52,29,11 then 0 is produced otherwise 1 is produced?

Thanks for your help
 
Upvote 0
Any ideas how i can reverse this so if A certain number is found IE 26,52,29,11 then 0 is produced otherwise 1 is produced?
Subtract the formula Mike gave you from 1...

=1-SIGN(SUMPRODUCT(COUNTIF(AC1:AC500, {26, 52, 35, 134})))
 
Upvote 0
Hi guys,
I have a new problem.
Using the above formula solved a lot of issues but i need to find a sequence of 3 specific numbers out of about 300 that might appear. So the sequence has to be 26,199,10. 26 must appear first then 199 then 10.How can i incorporate it into this formula above.
Thanks in advance.
 
Upvote 0
=SUMPRODUCT(A1:A100=26,A2:A101=199,A3:A102=10.26) will return the number of 26, 299, 10.26 sequences in A1:A102
 
Upvote 0
I have a new problem.
Using the above formula solved a lot of issues but i need to find a sequence of 3 specific numbers out of about 300 that might appear. So the sequence has to be 26,199,10. 26 must appear first then 199 then 10.How can i incorporate it into this formula above.

Your question is not clear to me...

1) Do those three numbers have to follow each other one cell immediately under the other (e.g.,AC4=26, AC5=199, AC6=10) or could there be other cell between them as long as they are in that order (e.g., AC4=26, AC17=199, AC26=10)?

2) I presume each of those three numbers should be marked with a 1, correct?

3) What about the other numbers you listed in your original message... should they still be marked with a 1 also, or for this question are we talking about those three numbers only?
 
Upvote 0
Cheers thanks for that. The only problem is the sequences don't appear one after another. IE the number 26 might appear at a 78, 199 might appear at 50 and 10 might come at 5. Once that sequence appears a 1 must be produced.Just like this =SIGN(SUMPRODUCT(COUNTIF(AC1:AC500, {26, 199,10}))). Except the sequence must be exact.

Thanks great work
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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