+ Reply to Thread
Results 1 to 7 of 7

Index and match frequency problem

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Question Index and match frequency problem

    I am trying to build a frequency table.

    In the source, I have a column with a bin ID. I have 7 other columns with numbers. There are multiple instances of each bin, and multiple (unique) instances of each of the other 7 columns (Sectors).

    Basically I would like to match each cell to its bin and count their frequency. My frequency table will be numbered 1 to the highest number given in a sector cell.

    For example:
    Bin Sector 1 Sector 2 Sector 3 Sector 4 Sector 5 Sector 6 Sector 7
    11 13 16 34 22 23 24 20
    16 66 73 18 11 19 20 29
    11 26 21 34 33 20 31 30

    For the frequency table, Bin 11 for Sector 3 would indicate 2 under the number 34 because 34 shows up twice. However, as you will notice the number 20 is also in both 11 bins, it will only be listed under its sectors as appearing once, because it does not appear in the same Bin AND Sector more than once. Am I being clear? Each bin is unique and each instance of a sector is unique.

    EDIT:

    Perhaps one solution would be a combination of an IF, MATCH, and COUNTIF statement?

    Like
    Please Login or Register  to view this content.
    Where you would drag that across and down, making substitutions.
    Last edited by peepingtom; 09-28-2013 at 02:52 PM. Reason: Potential Solution

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index and match frequency problem

    This should work. Change the references to match your data.
    Attached Files Attached Files
    Last edited by newdoverman; 09-28-2013 at 03:04 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Index and match frequency problem

    I don't think that's quite what I'm looking for.

    In short form the frequency table needs to look something like this:
    Bin Sector 34
    11 3 2
    16 3 0

    In the long form I will have 34 preceded by 1 to 33 and followed by 35 to whatever the highest cell value is.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Index and match frequency problem

    Sounds to me like you need a 3-dimensional table for this, and it will be huge?

    basically, lets say you have 20 bins and 7 sectors, and you want to ount how many times a specfic number appears in each of thos - thats already 140 variables, * how ever namny numbers you would have inside?

    (unless I have totally misunderstood?)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-11-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Index and match frequency problem

    Yes it probably would be quite a large table. I am thinking maybe it would be easier if I split it into separate sheets, i.e. Sector 1 is a sheet, Sector 2 is a sheet. I have done it before that way but there were fewer sectors and data was manually entered. I am trying to see if I could feed it historical numbers and get it to count them for me.

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Index and match frequency problem

    hi there. say your 1st table is in A1:H4 & your 2nd table is in K1:N4, your formula would start in M2:
    =COUNTIFS($A$2:$A$4,$K2,INDEX($B$2:$H$4,,$L2),M$1)
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  7. #7
    Registered User
    Join Date
    04-11-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Index and match frequency problem

    Quote Originally Posted by benishiryo View Post
    hi there. say your 1st table is in A1:H4 & your 2nd table is in K1:N4, your formula would start in M2:
    =COUNTIFS($A$2:$A$4,$K2,INDEX($B$2:$H$4,,$L2),M$1)
    This seems to be working! Thank you very much!

+ 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. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  2. frequency problem when 2 or more frequencies match
    By JTM1200 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2012, 03:39 PM
  3. Problem with INDEX, INDIRECT, MATCH, MATCH
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 09-01-2011, 05:51 PM
  4. INDEX / MATCH problem
    By Deborah in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-12-2006, 11:10 AM
  5. [SOLVED] Formula Problem which includes Sum,If,Frequency,match and row
    By BigH in forum Excel General
    Replies: 2
    Last Post: 02-12-2006, 12:50 PM

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