Results 1 to 5 of 5

Count Most Frequent Instances in a single cell

Threaded View

  1. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Count Most Frequent Instances in a single cell

    try Power Query

    source source Count
    Bob, John, Ken, Bob Bob
    2


    // Table1
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        SplitR = Table.ExpandListColumn(Table.TransformColumns(Source, {{"source", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "source"),
        Trim = Table.TransformColumns(SplitR,{{"source", Text.Trim, type text}}),
        Grp = Table.Group(Trim, {"source"}, {{"Count", each Table.RowCount(_), type number}}),
        Desc = Table.Sort(Grp,{{"Count", Order.Descending}}),
        FirstN = Table.FirstN(Desc,1)
    in
        FirstN
    or

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        List = Table.AddColumn(Source, "Name", each Text.Split([source],",")),
        Trim = Table.TransformColumns(Table.ExpandListColumn(List, "Name"),{{"Name", Text.Trim, type text}}),
        Grp = Table.Group(Trim, {"Name"}, {{"Count", each Table.RowCount(_), type number}}),
        FirstN = Table.FirstN(Table.Sort(Grp,{{"Count", Order.Descending}}),1)
    in
        FirstN
    Last edited by sandy666; 04-24-2023 at 09:19 PM. Reason: 2nd M

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to count up instances of a value in a cell from a different workbook
    By chibiraven in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-16-2021, 11:18 AM
  2. Replies: 5
    Last Post: 10-11-2019, 02:03 AM
  3. [SOLVED] Using COUNTIF to count multiple instances of data in a single cell
    By emsterv in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2017, 06:50 PM
  4. Replies: 6
    Last Post: 02-06-2013, 07:45 PM
  5. [SOLVED] multiple record to single with frequent change in string at forward slash
    By cruise.alter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2012, 06:26 AM
  6. [SOLVED] count # of instances in cell (a b a) answer 2 formula if possible
    By eric in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-12-2006, 02:20 PM
  7. Find Multiple instances of Single Criterion in Row & Return To a Single Col
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-09-2006, 10:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1