Hello! I have a Table just like the one above. I want to count the number of cells in the column Leg since the last entry, given a certain classification on the column Type.
For example, for the type KFT only, how many blank entries are there in the column Legendary since the last entry for Leg?
I know how to solve this issue creating helper columns. But given that I have too many types, I would have to create a helper column for each type, making my table too big given the amount of rows I have. Is there any way I can create a VBA function to perform this task for me, such that I only need one cell per type to let me know the amount of blank cells since last Leg entry for each type? Here is a short example of how my table looks, using only 2 types:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]#[/TD]
[TD="align: center"]Type[/TD]
[TD="align: center"]Com[/TD]
[TD="align: center"]Rar[/TD]
[TD="align: center"]Ep[/TD]
[TD="align: center"]Leg[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
In this example, I need a formula with output 0 for MSG, since it has been 0 entries since the last Leg for MSG, and output 1 for UNG, since it has been 1 entry since the last Leg for UNG
Thanks so much for the help!
For example, for the type KFT only, how many blank entries are there in the column Legendary since the last entry for Leg?
I know how to solve this issue creating helper columns. But given that I have too many types, I would have to create a helper column for each type, making my table too big given the amount of rows I have. Is there any way I can create a VBA function to perform this task for me, such that I only need one cell per type to let me know the amount of blank cells since last Leg entry for each type? Here is a short example of how my table looks, using only 2 types:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]#[/TD]
[TD="align: center"]Type[/TD]
[TD="align: center"]Com[/TD]
[TD="align: center"]Rar[/TD]
[TD="align: center"]Ep[/TD]
[TD="align: center"]Leg[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]UNG[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]MSG[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
In this example, I need a formula with output 0 for MSG, since it has been 0 entries since the last Leg for MSG, and output 1 for UNG, since it has been 1 entry since the last Leg for UNG
Thanks so much for the help!