Matrix Table and Array Formula

kenderweasel

New Member
Joined
Feb 17, 2017
Messages
40
Hi,

I've been given a set of data which has a column of tariff names on the left, and a list of included service codes across the top row. Inside this table, there are letters (A,O,N), indicating whether a particular service is included in the tariff. I need to create an array formula that looks up a given tariff, and returns the services codes that are listed as "A" for that tariff. Is this possible?

Eg,

[TABLE="width: 384"]


<colgroup><col width="64" style="width: 48pt;" span="6">
<tbody>[TR]

[TD="width: 64, bgcolor: transparent"]Tariff[/TD]

[TD="width: 64, bgcolor: transparent"]Code 1[/TD]

[TD="width: 64, bgcolor: transparent"]Code 2[/TD]

[TD="width: 64, bgcolor: transparent"]Code 3[/TD]

[TD="width: 64, bgcolor: transparent"]Code 4[/TD]

[TD="width: 64, bgcolor: transparent"]Code 5[/TD]

[/TR]

[TR]

[TD="bgcolor: transparent"]Tariff 1[/TD]

[TD="bgcolor: transparent"]A[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]N[/TD]

[TD="bgcolor: transparent"]A[/TD]

[/TR]

[TR]

[TD="bgcolor: transparent"]Tariff 2[/TD]

[TD="bgcolor: transparent"]N[/TD]

[TD="bgcolor: transparent"]N[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]O[/TD]

[/TR]

[TR]

[TD="bgcolor: transparent"]Tariff 3[/TD]

[TD="bgcolor: transparent"]A[/TD]

[TD="bgcolor: transparent"]A[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]A[/TD]

[TD="bgcolor: transparent"]A[/TD]

[/TR]

[TR]

[TD="bgcolor: transparent"]Tariff 4[/TD]

[TD="bgcolor: transparent"]N[/TD]

[TD="bgcolor: transparent"]N[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]O[/TD]

[TD="bgcolor: transparent"]A[/TD]

[/TR]


</tbody>[/TABLE]
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
With "Tariff" in A1 and "Code 1" in B1

and the given tariff in H1

in I1
=IFERROR(INDEX($B$1:$F$1,1,SMALL(IF(($B$2:$F$5="A")*(A$2:A$5=$H$1),COLUMN($B$2:$F$5)),ROW(A1))-(ROW(A$2)-1),1),"")
Array formula, use Ctrl-Shift-Enter
and copy down to I5 (since there are only a maximum of 5 codes)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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