How to count rows since a value occurred previously

krishnah

New Member
Joined
Aug 11, 2018
Messages
2
Hi I wonder if you can please assist me. I would like to find out how to create a formula that checks a range of cells and counts the number of rows since a specified value occurred last. For example:

If I was looking for the last time 6 occurred it is 3 rows down in Row A therefore the answer would be 3
If I was looking for the last time 1 occurred it is 1 row down in Row B therefore the answer is 1
If I was looking for the last time 35 occurred it is 6 rows down in Row C therefore the answer is 6


A B C D E
26111239
1629272138
616291133
3324192610
11203856
14135258
3322529

<colgroup><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi I wonder if you can please assist me. I would like to find out how to create a formula that checks a range of cells and counts the number of rows since a specified value occurred last. For example:

If I was looking for the last time 6 occurred it is 3 rows down in Row A therefore the answer would be 3
Since 6 appears more than once in the chart at a lower row number, can we assume you will be specifying both the value to find and the range to search? If so, where will these be specified at? If not, please explain why the second 6 is not the last occurrence.
 
Upvote 0
Since 6 appears more than once in the chart at a lower row number, can we assume you will be specifying both the value to find and the range to search? If so, where will these be specified at? If not, please explain why the second 6 is not the last occurrence.


Hi Rick, yes you are correct I would specify the value I am trying to find as well as the range to search. This would be in a separate column ie. Column G. I only need to count the number of rows since the last occurrence of the number (I would not need to see earlier occurrences of this number)
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,268
Members
449,149
Latest member
mwdbActuary

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