Help Needed with Formula: FIND the most common number in a list that follows a given value

D_Spark

Board Regular
Joined
Feb 4, 2007
Messages
232
I have a workbook Range (A1:A500)........text values
Cell C1 represent the last value in range (A1:A500)
I need help with creating a formula in cell D1.
This will return the most common text value in the range that follows an occurrence determined by C1.


eg if C1 was to equal "Paul" then D1 would show "Helen", as "Helen" is the most common text value that follows a text value of "Paul" in the range

A1 = Paul
A2 = Helen
A3 = Paul
A4 = Duncan
A5 = Paul
A6 = Helen
A7 = Duncan
A8 = Duncan
A9 = Paul
A10 = Helen
A11 = Paul
A12 = Helen
A13 = Paul
A14 = Duncan
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi Spark
Your problem seems to be of the "how to rank based on number of occurrences" and is been ask many times, you could use the formula that user mattaustin01 posted that works fine to find most common text value

{=INDEX(yourrange,MATCH(MAX(COUNTIF(yourrange,yourrange)),COUNTIF(yourrange,yourrange),0))}

I think now you only need to find the range below Paul and you are done
Cheers
Sergio
 
Upvote 0
I see you really mean "immediately follows" no just "follows" so I guess you need a UDF
Cheers
Sergio
 
Upvote 0
I see you really mean "immediately follows" no just "follows" so I guess you need a UDF
Cheers
Sergio



thanks Sergio

Ive needed to move the cells on the worksheet around, but the formula below seems in cell L169 seems to work to predict

=IFERROR(MODE(IF($J$2:J167=J168,$J$3:J168)),INDEX($J$2:J168,MAX(IF($J$2:J167=J168,ROW($J$3:J168)))))



How can I use the above and enter a formula into L170 to calculate the 2nd most common occurrence, not the most common?
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,174
Members
449,071
Latest member
cdnMech

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