CaptainCsaba
Board Regular
- Joined
- Dec 8, 2017
- Messages
- 78
Hello! So I have quite a weird problem. In column B and C I both have stuff and a lot of blank cells. What I need to figure out is that I need to fill up column B (not everywhere) the following way (this is just an example, not the real values):
What I have:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Potato[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What I need:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]Potato[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
There are other columns that is why we need to do it this way and I don't want to further confuse you guys, but basically we need to fill up the B column with it's values. The values need to go both upwards and downwards. They need to fill upwards until something is reached in column C and that value in column C should be included. And they need to fill downward until a value is reached in column C but that value should not be included. This might seem a bit weird but you can see it above in the example. The value "C" was filled upward until it reached Apple and appeared next to it. It was also filled downward until it reached Potato but it did not appeared next to potato, since the next value is probably going to be next to it which is "D".
It might seem a bit weird but there are other columns and we actually need it like this. Some of the "fruits" in column C does not have a value in column "b" and they need to be left empty, that is why it needs to happen like this. Does somebody have an idea?
So what is needed basically: the values in column B to be filled upward until reach a value in column C and the value in column B should appear next to the value in column C. And the same values also need to be filled downward until they reach a value column C but should NOT appear next to that value.
What I have:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD][/TD]
[/TR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TD]
[/TR]
</tbody>[/TABLE]
There are other columns that is why we need to do it this way and I don't want to further confuse you guys, but basically we need to fill up the B column with it's values. The values need to go both upwards and downwards. They need to fill upwards until something is reached in column C and that value in column C should be included. And they need to fill downward until a value is reached in column C but that value should not be included. This might seem a bit weird but you can see it above in the example. The value "C" was filled upward until it reached Apple and appeared next to it. It was also filled downward until it reached Potato but it did not appeared next to potato, since the next value is probably going to be next to it which is "D".
It might seem a bit weird but there are other columns and we actually need it like this. Some of the "fruits" in column C does not have a value in column "b" and they need to be left empty, that is why it needs to happen like this. Does somebody have an idea?
So what is needed basically: the values in column B to be filled upward until reach a value in column C and the value in column B should appear next to the value in column C. And the same values also need to be filled downward until they reach a value column C but should NOT appear next to that value.