Contains Subarray

bradbarbin

New Member
Joined
Aug 8, 2018
Messages
2
I'm trying to figure out a formula to determine whether an occurrence contains a value with the data in this sort of format. In the example below, I'd like the formula to output TRUE if the occurence contains the number 2, and false if it doesn't. I've been trying SUMPRODUCT and INDEX with no luck:

Observation 1
Observation 1
Observation 2
Observation 2
Observation 2
Observation 2
Observation 3
Observation 3
Observation 3
Observation 3
Observation 3
Observation 4
Observation 4
Observation 5
Observation 5
Observation 5

<tbody>
[TD="class: xl63"] Occurrence [/TD]
[TD="class: xl63, width: 64, align: center"] Data [/TD]
[TD="class: xl63, width: 64"] Result (Occurrence contains 2) [/TD]

[TD="align: center"]1[/TD]
[TD="align: center"]TRUE[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]TRUE[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]4
[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]5
[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]FALSE[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]TRUE[/TD]

[TD="align: center"]9[/TD]
[TD="align: center"]TRUE[/TD]

[TD="align: center"]2
[/TD]
[TD="align: center"]TRUE[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]TRUE
[/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]TRUE
[/TD]

</tbody>
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi. Explain the rules again. Why does 'Observation 1' lead to TRUE? Doesnt contain 2 does it?
 
Upvote 0
Hi Steve the fish, thank you.

What I'm trying to do is develop a matrix for conditional probability. This helped, but I realized that I need it within an array due to the large number of occurences and data (in the real world).

Here is my simplified explanation. I have highlighted the part in the formula that is hardcoded, and needs replaced with a dyanmic array that returns the same results from above.

8p7u59Y.jpg
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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