+ Reply to Thread
Results 1 to 3 of 3

Count Matched Results ( Frequency)

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Count Matched Results ( Frequency)

    Hi All,
    This is likely more of a database need but since I don't have one easily accessible, I'm doing by Excel.
    In the attached workbook are test results for L,M,D,B tests. A before treatment and an after treatment value for each subject (serial) in the workbook.
    What is needed:
    For each value in L, B, M, D rows, count for each Before Treated value, the number of After Treatment values that occur by each After Treatment value (a count of matched occurrences).
    Example:
    For each Before Value 1, how many times is the After Treatment value 1., and 2, and 3 etc, up through 15.
    So, the value in cell d1154 (3) is matched to value After Treatment to al1154 (2).
    So, the matrix at left in spreadsheet would have a 1 in d1164.
    The next time a 2 is matched to a Before Treatment value of 3, the value in d1164 would increase by 1 (a counter of frequency).
    Note: There may not be a Before or After 1 or other number; 1 through 15 were chosen as they are the possible range values.
    I thought match or look-up but since the results can't be ordered (it would ruin the relationship of Before and After results; become unmatched) I didn't know which way to go.
    Thanks for any suggestions/help!
    Bob
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Count Matched Results ( Frequency)

    You can do this using Power Query, to extract the data from your results workbook, normalise the data (one row per item, with a Pre & Post value, then summarise using a pivot table.

    Query:
    Please Login or Register  to view this content.
    Close and Load To Data Model, then create a Pivot Table from the Data Model, with [Pre] in Rows, [Post] in Columns and [Count of Items] in Values.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: Count Matched Results ( Frequency)

    Thanks Olly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Matching Data Output Matched results
    By jamesc37 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2018, 11:32 AM
  2. [SOLVED] FREQUENCY function returns wrong results
    By imatzav in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-30-2017, 05:47 AM
  3. Replies: 6
    Last Post: 02-12-2015, 04:08 PM
  4. [SOLVED] Formula to display associated matched results
    By hotwax in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-02-2014, 10:31 PM
  5. [SOLVED] Create Data validation list from matched criteria value results
    By lukeeb in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-10-2014, 10:39 PM
  6. [SOLVED] Count If Function To Count Frequency Of Long Numbers
    By RowanB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 05:18 AM
  7. [SOLVED] How to write matched results to a specific cell.
    By shart2k12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2013, 10:17 AM

Tags for this Thread

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