Return Array Where Values Equal Conditional Statements

mysites

New Member
Joined
Jul 12, 2017
Messages
7
I'm in need of an Excel formula that returns an array (A long array) where each index value is equal to 1 or 0 - the True/False statement of whether each cell in a range of cells is equal to a value in another range of cells.

I have the following range of cells (This range is really 100 cells long, but shortened for explanation purposes)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Member1[/TD]
[TD]Member2[/TD]
[TD]Member3[/TD]
[TD]Member4[/TD]
[TD]Member5[/TD]
[TD]Member6[/TD]
[TD]Member7[/TD]
[TD]Member8[/TD]
[TD]Member9[/TD]
[TD]Member10[/TD]
[/TR]
</tbody>[/TABLE]

I also have the following mapping table which may be out of numerical/alphabetical order at any time:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Member
[/TD]
[TD]Group[/TD]
[/TR]
[TR]
[TD]Member1[/TD]
[TD]Group 1[/TD]
[/TR]
[TR]
[TD]Member2[/TD]
[TD]Group 2[/TD]
[/TR]
[TR]
[TD]Member3[/TD]
[TD]Group 1[/TD]
[/TR]
[TR]
[TD]Member4[/TD]
[TD]Group 2[/TD]
[/TR]
[TR]
[TD]Member5[/TD]
[TD]Group 1[/TD]
[/TR]
[TR]
[TD]Member6[/TD]
[TD]Group 2[/TD]
[/TR]
[TR]
[TD]Member7[/TD]
[TD]Group 1[/TD]
[/TR]
[TR]
[TD]Member8[/TD]
[TD]Group 2[/TD]
[/TR]
[TR]
[TD]Member9[/TD]
[TD]Group 1[/TD]
[/TR]
[TR]
[TD]Member10[/TD]
[TD]Group 2[/TD]
[/TR]
</tbody>[/TABLE]


I'd like a formula that will output the following array value {1,0,1,0,1,0,1,0,1,0}(For use inside a formula) when fed the mapping value of "Group 1". The array value should be based on the position of the Members in the horizontal range at the top, not based on the mapping table order.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
=MMULT(--TRANSPOSE(IF(B2:K2=B5:B14,C5:C14="Group 1")),TRANSPOSE(COLUMN(B2:K2)^0))

will return {0;0;0;0;1;0;1;0;0;1} for the example illustrated below:


Excel 2010
ABCDEFGHIJK
1
2Member1Member2Member3Member4Member5Member6Member7Member8Member9Member10
3
4MemberGroup
5Member7Group 1
6Member8Group 2
7Member9Group 2
8Member10Group 1
9Member1Group 2
10Member2Group 2
11Member3Group 2
12Member4Group 2
13Member5Group 1
14Member6Group 2
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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