I would like to analyze a list of numbers and be able to display how many listings have occured since a number appeared before. In other words : the string 10,15,24,18,19,15 : Looking at 15 would display the number 4. Any ideas?
I would like to analyze a list of numbers and be able to display how many listings have occured since a number appeared before. In other words : the string 10,15,24,18,19,15 : Looking at 15 would display the number 4. Any ideas?
Are these numbers in a single cell or in a row or column?
ChemistB
My 2?
substitute commas with semi-colons if your region settings requires
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
I have the numbers are listed in a column.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Hi NBVC,
I think he/she's looking at a running formula down column B which looks to the left and says when that last appeared. I modified your formula a bit to see if it worked for that and works when there are only duplicates but not for triplicates (I added another 15 and the second 15 gives an incorrect value of 7 but the 3rd one is right at 3). Take a look and see if you can modify the formula.
One way:
=MATCH(2,(1/(A1:A6=D1)))-MATCH(2,(1/(A1:INDEX(A:A,MATCH(2,(1/(A1:A6=D1)))-1)=D1)))
where A1:A6 is the whole range of numbers and D1 contains the number to evaluate (e.g. 15)
Note: The formula must be confirmed with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear around the formula.
How about in B2, CSE confirmed and copied down?
=IF(COUNTIF($A$2:A2,A2)=1,0,ROW()-MATCH(2,(1/($A$2:INDEX(A:A,ROW()-1)=A2)))-1)
As our friends across the pond would say, "Works a treat." Nice one, NBVC.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks