'Count rows since last occurrence of value , excluding blank cells from the count
I want to count the number of rows since the last occurrence of a specific value, while excluding rows where the cell is a blank or empty value. I have provided a sample of fake data to try to explain what I'm asking. So, with the sample data, on every occurrence of "Apple", I would like to show the number of valued rows since the last occurrence of "Apple". I currently have a formula like this:
=ROW()-MAX(FILTER(ROW(INDIRECT("B1:B"&ROW()-1)),INDIRECT("B1:B"&ROW()-1)=INDIRECT("B"&ROW())))
The formula gives me the number of rows since the last occurrence, but does not exclude the blank cells, and I'm wanting to figure out a way to get this result without counting the rows with blank cells in the column.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
