I have a large table in the form:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Months
[/TD]
[TD]August
[/TD]
[TD]September
[/TD]
[TD]October
[/TD]
[TD]November
[/TD]
[TD]December
[/TD]
[/TR]
[TR]
[TD]August
[/TD]
[TD]112
[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]September
[/TD]
[TD][/TD]
[TD]118
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[/TR]
[TR]
[TD]October
[/TD]
[TD][/TD]
[TD][/TD]
[TD]231
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]November
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]142
[/TD]
[TD]J
[/TD]
[/TR]
[TR]
[TD]December
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]253
[/TD]
[/TR]
</tbody>[/TABLE]
Which only has diagonal values corresponding to the months that do intersect along the rows and columns.
I also have weights like the following: 80%, 110%, 95%.
I would like to multiply these weights by the diagonal entries depending on how far the column and row months are away from each other.
For example for the August row, we would have:
The same would be extended to the September row etc.
Unfortunately, I am not sure how to do this with VB so any help would be very appreciated.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Months
[/TD]
[TD]August
[/TD]
[TD]September
[/TD]
[TD]October
[/TD]
[TD]November
[/TD]
[TD]December
[/TD]
[/TR]
[TR]
[TD]August
[/TD]
[TD]112
[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]September
[/TD]
[TD][/TD]
[TD]118
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[/TR]
[TR]
[TD]October
[/TD]
[TD][/TD]
[TD][/TD]
[TD]231
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]November
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]142
[/TD]
[TD]J
[/TD]
[/TR]
[TR]
[TD]December
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]253
[/TD]
[/TR]
</tbody>[/TABLE]
Which only has diagonal values corresponding to the months that do intersect along the rows and columns.
I also have weights like the following: 80%, 110%, 95%.
I would like to multiply these weights by the diagonal entries depending on how far the column and row months are away from each other.
For example for the August row, we would have:
- A = 112*80% (since it is one month away, we would multipy it by the first weight),
- B = 112*80%*110% (October is two months away from August so we would multiply by the first and second weights)
- C = 112*80%*110%*95% (Multiply by the three weights)
- D = 112*80%*110%*95%*95% (since we have run out of weights to use, we will use the last weight we had).
The same would be extended to the September row etc.
Unfortunately, I am not sure how to do this with VB so any help would be very appreciated.