I have a large data table that takes the form of n rows of Reference1 and z columns of Reference2, for each cell there is an output data that is numeric. Many output cells are zero are blank. I need to extract the data relating to the non-zero cells in the form of a simple 3 column multiple row table where the columns are Reference1, Reference2, Amount. An example Input Data Table and a fraction of the desired output data table is shown below.
[TABLE="width: 435"]
<tbody>[TR]
[TD="width: 87"]Input Table[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]F00004[/TD]
[TD]F00005[/TD]
[TD]F00006[/TD]
[TD]F00007[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]LB2000012[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000029[/TD]
[TD="class: xl63"] 21,072.70[/TD]
[TD="class: xl63"] 19,247.30[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000030[/TD]
[TD="class: xl63"] 19.62[/TD]
[TD="class: xl63"] 17.18[/TD]
[TD="class: xl63"] 3.81[/TD]
[TD="class: xl63"] 8.09[/TD]
[/TR]
[TR]
[TD]LB2000033[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,626.08[/TD]
[TD="class: xl63"] 9,659.63[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000036[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] 2,250.00[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000039[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000040[/TD]
[TD="class: xl63"] 1,560.42[/TD]
[TD="class: xl63"] 1,569.71[/TD]
[TD="class: xl63"] 244.89[/TD]
[TD="class: xl63"] 187.09[/TD]
[/TR]
[TR]
[TD]LB2000042[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000043[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,333.20[/TD]
[TD="class: xl63"] 10,368.64[/TD]
[TD="class: xl63"] 1,197.54[/TD]
[TD="class: xl63"] 1,197.54[/TD]
[/TR]
[TR]
[TD]LB2000045[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000047[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000048[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000050[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000052[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Desired Output Table[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]Ref1[/TD]
[TD="class: xl63"] Ref2[/TD]
[TD="class: xl63"] Amount[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000029[/TD]
[TD="class: xl63"] 21,072.70[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000030[/TD]
[TD="class: xl63"] 19.62[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,626.08[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000040[/TD]
[TD="class: xl63"] 1,560.42[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,333.20[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000029[/TD]
[TD="class: xl63"] 19,247.30[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000030[/TD]
[TD="class: xl63"] 17.18[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,659.63[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000040[/TD]
[TD="class: xl63"] 2,250.00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,368.64[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 435"]
<tbody>[TR]
[TD="width: 87"]Input Table[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]F00004[/TD]
[TD]F00005[/TD]
[TD]F00006[/TD]
[TD]F00007[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]LB2000012[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000029[/TD]
[TD="class: xl63"] 21,072.70[/TD]
[TD="class: xl63"] 19,247.30[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000030[/TD]
[TD="class: xl63"] 19.62[/TD]
[TD="class: xl63"] 17.18[/TD]
[TD="class: xl63"] 3.81[/TD]
[TD="class: xl63"] 8.09[/TD]
[/TR]
[TR]
[TD]LB2000033[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,626.08[/TD]
[TD="class: xl63"] 9,659.63[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000036[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] 2,250.00[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000039[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000040[/TD]
[TD="class: xl63"] 1,560.42[/TD]
[TD="class: xl63"] 1,569.71[/TD]
[TD="class: xl63"] 244.89[/TD]
[TD="class: xl63"] 187.09[/TD]
[/TR]
[TR]
[TD]LB2000042[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000043[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,333.20[/TD]
[TD="class: xl63"] 10,368.64[/TD]
[TD="class: xl63"] 1,197.54[/TD]
[TD="class: xl63"] 1,197.54[/TD]
[/TR]
[TR]
[TD]LB2000045[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000047[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000048[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000050[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD]LB2000052[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[TD="class: xl63"] -[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Desired Output Table[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]Ref1[/TD]
[TD="class: xl63"] Ref2[/TD]
[TD="class: xl63"] Amount[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000029[/TD]
[TD="class: xl63"] 21,072.70[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000030[/TD]
[TD="class: xl63"] 19.62[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,626.08[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000040[/TD]
[TD="class: xl63"] 1,560.42[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00004[/TD]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,333.20[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000029[/TD]
[TD="class: xl63"] 19,247.30[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000030[/TD]
[TD="class: xl63"] 17.18[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000035[/TD]
[TD="class: xl63"] 9,659.63[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000040[/TD]
[TD="class: xl63"] 2,250.00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F00005[/TD]
[TD]LB2000044[/TD]
[TD="class: xl63"] 10,368.64[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]