Counting past occurrence given a classification

makae90

New Member
Joined
Sep 28, 2017
Messages
2
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:

#TypeComRarEpLeg
1MSG41
2UNG321
3UNG41
4MSG311
5UNG41
6UNG41
7MSG311

<tbody>
</tbody>

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!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,215,523
Messages
6,125,320
Members
449,218
Latest member
Excel Master

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