Determine most common text in an incomplete list

%3CLINGO-SUB%20id%3D%22lingo-sub-1973886%22%20slang%3D%22en-US%22%3EDetermine%20most%20common%20text%20in%20an%20incomplete%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1973886%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20looking%20to%20determine%20the%20most%20common%20occurrence%20of%20a%20text%20entry%20in%20a%20list.%20I%20am%20using%20the%20following%20formula%3A%3C%2FP%3E%3CP%3E%7B%3DINDEX(E4%3AE11%2CMODE(IF(E4%3AE11%20%26lt%3B%26gt%3B%200%2CMATCH(E4%3AE11%2CE4%3AE11%2C0))))%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20works%20but%20only%20when%203%20or%20more%20entries%20are%20in%20the%20list.%20I%20am%20looking%20to%20calculate%20this%20based%20on%20a%20list%20that%20is%20part%20of%20a%20template%20making%20up%20a%20form%2C%20so%20the%20list%20is%20pre-defined%20as%20being%208%20entries%20long%20and%20defaults%20to%20blank%20cells%20when%20the%20worksheet%20%22template%22%20is%20opened.%20Additionally%2C%20there%20may%20only%20be%20one%20entry%2C%20or%20two%2C%20so%20less%20than%20the%20three%20required%20to%20use%20the%20formula%20above%20to%20calculate%20an%20automated%20fill.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20table%20this%20forms%20part%20of%20is%20below%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Jeff_Ho_0-1607554135467.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239310i9B04FB2795CACECD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Jeff_Ho_0-1607554135467.png%22%20alt%3D%22Jeff_Ho_0-1607554135467.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20list%20is%20from%20E4%20to%20E11.%20The%20entries%20in%20this%20list%20can%20be%20one%20of%20five%20possibilities%20(5%2C%2010%2C%2020%2C%2050)%20for%20each%20row.%20How%20do%20I%20calculate%20(into%20E12)%20the%20most%20common%20number%20if%20there%20is%20only%201%20or%202%20entries%20in%20the%20list%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditionally%2C%20if%20there%20are%20an%20even%20number%20of%20entries%2C%20how%20would%20I%20then%20decide%20which%20is%20the%20most%20common%20number%20based%20on%20say%20which%20of%20the%20%22levels%20of%20detail%22%20had%20the%20longest%20combined%20total%20length%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHopefully%20that%20all%20makes%20sense%2C%20I%20have%20attached%20the%20example%20worksheet%20from%20the%20image%20above%20in%20case%20that%20is%20of%20any%20assistance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJeff%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1973886%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1974799%22%20slang%3D%22en-US%22%3ERe%3A%20Determine%20most%20common%20text%20in%20an%20incomplete%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1974799%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F587746%22%20target%3D%22_blank%22%3E%40Jeff_Ho%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20you%20could%20use%20the%20frequency%20function%20(see%20attached).%20You%20may%20be%20able%20to%20shorten%20the%20formula%20some%20if%20you%20have%20the%20LET%20function%20as%20some%20parts%20are%20redundant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20assuming%20total%20length%20will%20be%20zero%20if%20level%20of%20detail%20is%20zero%2C%20so%20I%20didn't%20include%20a%20test%2Fcondition%20for%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi All,

 

I am looking to determine the most common occurrence of a text entry in a list. I am using the following formula:

{=INDEX(E4:E11,MODE(IF(E4:E11 <> 0,MATCH(E4:E11,E4:E11,0))))}

 

The formula works but only when 3 or more entries are in the list. I am looking to calculate this based on a list that is part of a template making up a form, so the list is pre-defined as being 8 entries long and defaults to blank cells when the worksheet "template" is opened. Additionally, there may only be one entry, or two, so less than the three required to use the formula above to calculate an automated fill.

 

The table this forms part of is below:

Jeff_Ho_0-1607554135467.png

The list is from E4 to E11. The entries in this list can be one of five possibilities (5, 10, 20, 50) for each row. How do I calculate (into E12) the most common number if there is only 1 or 2 entries in the list? 

 

Additionally, if there are an even number of entries, how would I then decide which is the most common number based on say which of the "levels of detail" had the longest combined total length?

 

Hopefully that all makes sense, I have attached the example worksheet from the image above in case that is of any assistance.

 

Jeff

3 Replies

@Jeff_Ho 

 

I believe you could use the frequency function (see attached). You may be able to shorten the formula some if you have the LET function as some parts are redundant.

 

I'm assuming total length will be zero if level of detail is zero, so I didn't include a test/condition for that.

Thanks @JMB17 

 

Your solution works perfectly, thanks for taking the time to solve this one for me, it is much appreciated.

I'm glad to hear that worked for you.