Restructure of data using array formulas

JannetteChristie

Board Regular
Joined
Dec 14, 2015
Messages
127
Office Version
  1. 365
Hello,

I have the following data:

Book1
CDLAK
111VR3-1005-LHT1No
122FRB501Yes
133FRB651Yes
144FS5-WRAS1Yes
155EC651No
166DPS-WMB-EC651Yes
177DPS-FMB-EC651Yes
188MSV1-0505-LHM1No
199VR3-1005-LHT1No
2010FRB651Yes
2111FRB501Yes
2212FS5-WRAS1Yes
2313LOW-UK11001000601No
2414VR4-0509-LHM1No
2515FRB502Yes
2616FS5-WRAS1Yes
2717VMV3-10-H1101No
2818FRB1002Yes
2919VMV-NOTE1Yes
3020FS5-WRAS1Yes
3121VR3-0409-LHT1No
3222VR2-0507-LHM1No
3323FRB502Yes
3424FS5-WRAS1Yes
Create Quote


I am trying to use some excel formulas to show the data in this format:

Book1
ABCDEFGHIJKLMNOPQ
2Standard1VR3-1005-LHT1DUTYPOINTRecommended Extras3FRB501FRB651FS5-WRAS1
3Standard5EC651CONDITIONERRecommended Extras2DPS-WMB-EC651DPS-FMB-EC651
4Standard8MSV1-0505-LHM1HIU
5Standard9VR3-1005-LHT1DUTYPOINTRecommended Extras3FRB501FRB651FS5-WRAS1
6Standard13LOW-UK11001000601HIU
7Standard14VR4-0509-LHM1DUTYPOINTRecommended Extras2FRB502FS5-WRAS1
8Standard17VMV3-10-H1101DUTYPOINTRecommended Extras3FRB1002VMV-NOTE1FS5-WRAS1
9Standard21VR3-0409-LHT1DUTYPOINT
10Standard22VR2-0507-LHM1DUTYPOINTRecommended Extras2FRB502FS5-WRAS1
PrintQuoteData


To get only the Products that have not got recommended extra, I have used the following formula:
{=IFERROR(INDEX('Create Quote'!$A$1:$AL$101,SMALL(IF(('Create Quote'!$A$1:$A$110<>"")*('Create Quote'!$A$1:$A$110<>"To start please select either Booster Set / Standard")*('Create Quote'!$AK$1:$AK$110="No"),ROW('Create Quote'!$A$1:$A$110)),ROW(1:1)),4),"")}

I am struggling to show the recommend extras for each of the products where they exist - hoping that this makes some sense
 

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
Check the following proposed formulas, maybe, they can help you a little.


<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:161.58px;" /><col style="width:37.07px;" /><col style="width:38.97px;" /><col style="width:31.37px;" /><col style="width:31.37px;" /><col style="width:31.37px;" /><col style="width:122.61px;" /><col style="width:119.76px;" /><col style="width:121.66px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td><td >H</td><td >I</td><td >J</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td > </td><td >VR3-1005-LHT</td><td style="text-align:right; ">1</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB50</td><td >FRB65</td><td >VR3-1005-LHT</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td > </td><td >EC65</td><td style="text-align:right; ">5</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >DPS-WMB-EC65</td><td >EC65</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td > </td><td >MSV1-0505-LHM</td><td style="text-align:right; ">8</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td > </td><td >VR3-1005-LHT</td><td style="text-align:right; ">9</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB65</td><td >FRB50</td><td >VR3-1005-LHT</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td > </td><td >LOW-UK1100100060</td><td style="text-align:right; ">13</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td > </td><td >VR4-0509-LHM</td><td style="text-align:right; ">14</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >FRB50</td><td >VR4-0509-LHM</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td > </td><td >VMV3-10-H110</td><td style="text-align:right; ">17</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB100</td><td >VMV-NOTE</td><td >VMV3-10-H110</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td > </td><td >VR3-0409-LHT</td><td style="text-align:right; ">21</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td > </td><td >VR2-0507-LHM</td><td style="text-align:right; ">22</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >FRB50</td><td >VR2-0507-LHM</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td style="text-align:right; ">1</td><td >VR3-1005-LHT</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td style="text-align:right; ">2</td><td >FRB50</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td style="text-align:right; ">3</td><td >FRB65</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >16</td><td style="text-align:right; ">4</td><td >FS5-WRAS</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >17</td><td style="text-align:right; ">5</td><td >EC65</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >18</td><td style="text-align:right; ">6</td><td >DPS-WMB-EC65</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >19</td><td style="text-align:right; ">7</td><td >DPS-FMB-EC65</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >20</td><td style="text-align:right; ">8</td><td >MSV1-0505-LHM</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >21</td><td style="text-align:right; ">9</td><td >VR3-1005-LHT</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >22</td><td style="text-align:right; ">10</td><td >FRB65</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >23</td><td style="text-align:right; ">11</td><td >FRB50</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >24</td><td style="text-align:right; ">12</td><td >FS5-WRAS</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >25</td><td style="text-align:right; ">13</td><td >LOW-UK1100100060</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >26</td><td style="text-align:right; ">14</td><td >VR4-0509-LHM</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >27</td><td style="text-align:right; ">15</td><td >FRB50</td><td style="text-align:right; ">2</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >28</td><td style="text-align:right; ">16</td><td >FS5-WRAS</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >29</td><td style="text-align:right; ">17</td><td >VMV3-10-H110</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >30</td><td style="text-align:right; ">18</td><td >FRB100</td><td style="text-align:right; ">2</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >31</td><td style="text-align:right; ">19</td><td >VMV-NOTE</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >32</td><td style="text-align:right; ">20</td><td >FS5-WRAS</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >33</td><td style="text-align:right; ">21</td><td >VR3-0409-LHT</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >34</td><td style="text-align:right; ">22</td><td >VR2-0507-LHM</td><td style="text-align:right; ">1</td><td >No</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >35</td><td style="text-align:right; ">23</td><td >FRB50</td><td style="text-align:right; ">2</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >36</td><td style="text-align:right; ">24</td><td >FS5-WRAS</td><td style="text-align:right; ">1</td><td >Yes</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >B2</td><td >{=INDEX($B$13:$B$36,SUMPRODUCT(SMALL(IF($D$13:$D$36="No",ROW($D$13:$D$36)),ROWS(D$2:D2)))-ROW($D$12))}</td></tr><tr><td >C2</td><td >{=INDEX($A$13:$A$36,SUMPRODUCT(SMALL(IF($B$13:$B$36=B2,ROW($B$13:$B$36)),COUNTIF($B$2:B2,B2)))-ROW($D$12))}</td></tr><tr><td >D2</td><td >=VLOOKUP(B2,$B$13:$C$36,2,0)</td></tr><tr><td >G2</td><td >=IF(C3="",$A$36-C2,C3-C2-1)</td></tr><tr><td >H2</td><td >=IF($G2>0,OFFSET($A$1,MATCH($C2,$A$1:$A$36,0)+MOD(COLUMNS($H$2:H2),$G2)-1,1),"")</td></tr><tr><td >I2</td><td >=IF($G2>0,OFFSET($A$1,MATCH($C2,$A$1:$A$36,0)+MOD(COLUMNS($H$2:I2),$G2)-1,1),"")</td></tr><tr><td >J2</td><td >=IF($G2>0,OFFSET($A$1,MATCH($C2,$A$1:$A$36,0)+MOD(COLUMNS($H$2:J2),$G2)-1,1),"")</td></tr></table></td></tr></table>
 
Upvote 0
Thanks for your response Dante,

I am a little confused on the login used for cell H2,I2 and J2. Am I right in thing that the data that is shown in A13 to A36 is the data at the top of the original post. If I am correct can I just advise that this data is actually on another sheet in the workbook, I assume that this will mean changes to the function you have shown
 
Upvote 0
Thanks for your response Dante,

I am a little confused on the login used for cell H2,I2 and J2. Am I right in thing that the data that is shown in A13 to A36 is the data at the top of the original post. If I am correct can I just advise that this data is actually on another sheet in the workbook, I assume that this will mean changes to the function you have shown

These would be the changes

<b>Sheet2</b><br /><br /><table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:136.87px;" /><col style="width:23.76px;" /><col style="width:23.76px;" /><col style="width:21.86px;" /><col style="width:21.86px;" /><col style="width:13.31px;" /><col style="width:118.81px;" /><col style="width:135.92px;" /><col style="width:141.62px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td><td >H</td><td >I</td><td >J</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td > </td><td >VR3-1005-LHT</td><td style="text-align:right; ">1</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB50</td><td >FRB65</td><td >VR3-1005-LHT</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td > </td><td >EC65</td><td style="text-align:right; ">5</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >DPS-WMB-EC65</td><td >EC65</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td > </td><td >MSV1-0505-LHM</td><td style="text-align:right; ">8</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td > </td><td >VR3-1005-LHT</td><td style="text-align:right; ">9</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB65</td><td >FRB50</td><td >VR3-1005-LHT</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td > </td><td >LOW-UK1100100060</td><td style="text-align:right; ">13</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td > </td><td >VR4-0509-LHM</td><td style="text-align:right; ">14</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >FRB50</td><td >VR4-0509-LHM</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td > </td><td >VMV3-10-H110</td><td style="text-align:right; ">17</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">3</td><td >FRB100</td><td >VMV-NOTE</td><td >VMV3-10-H110</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td > </td><td >VR3-0409-LHT</td><td style="text-align:right; ">21</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">0</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td > </td><td >VR2-0507-LHM</td><td style="text-align:right; ">22</td><td style="text-align:right; ">1</td><td > </td><td > </td><td style="text-align:right; ">2</td><td >FRB50</td><td >VR2-0507-LHM</td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >B2</td><td >{=INDEX(Sheet1!$B$13:$B$36,SUMPRODUCT(SMALL(IF(Sheet1!$D$13:$D$36="No",ROW(Sheet1!$D$13:$D$36)),ROWS(D$2:D2)))-ROW(Sheet1!$D$12))}</td></tr><tr><td >C2</td><td >{=INDEX(Sheet1!$A$13:$A$36,SUMPRODUCT(SMALL(IF(Sheet1!$B$13:$B$36=B2,ROW(Sheet1!$B$13:$B$36)),COUNTIF($B$2:B2,B2)))-ROW(Sheet1!$D$12))}</td></tr><tr><td >D2</td><td >=VLOOKUP(B2,Sheet1!$B$13:$C$36,2,0)</td></tr><tr><td >G2</td><td >=IF(C3="",Sheet1!$A$36-C2,C3-C2-1)</td></tr><tr><td >H2</td><td >=IF($G2>0,OFFSET(Sheet1!$A$1,MATCH($C2,Sheet1!$A$1:$A$36,0)+MOD(COLUMNS($H$2:H2),$G2)-1,1),"")</td></tr><tr><td >I2</td><td >=IF($G2>0,OFFSET(Sheet1!$A$1,MATCH($C2,Sheet1!$A$1:$A$36,0)+MOD(COLUMNS($H$2:I2),$G2)-1,1),"")</td></tr><tr><td >J2</td><td >=IF($G2>0,OFFSET(Sheet1!$A$1,MATCH($C2,Sheet1!$A$1:$A$36,0)+MOD(COLUMNS($H$2:J2),$G2)-1,1),"")</td></tr></table></td></tr></table>
 
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