+ Reply to Thread
Results 1 to 3 of 3

Frequency of two criteria

  1. #1
    Registered User
    Join Date
    03-14-2007
    Posts
    1

    Frequency of two criteria

    I know there must be a simple way of doing this, but I can't for the life of me figure it out!

    Given a table of two columns (animal and letter), I need to know the frequency of a result where it appears in BOTH columns.

    Eg.

    Cat A
    Cat A
    Pig A
    Dog A
    Cat A
    Dog B
    Dog A
    Cat B

    In this case I want to show in a column that:
    Cat A has a frequency of 3
    Cat B has a frequency of 1
    Dog A has a frequency of 2
    Dog B has a frequency of 1
    Pig A has a frequency of 1
    Pig B has a frequency of 0

    Many thanks, and apologies for the layout

    Smint

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    To obtain a single copy of data you can use menu 'Data', 'Filter', 'Adavanced filter', then choose copy in another location, in the first textbox write 'a:b', in 'copy in' 'd:e' and then choos copy unique. (i am not sure for the exact english syntax because i have excel in another language).

    At this point, to obtain the count of matchs for each row you have data in columns d:e in column F insert the formula
    =SUM(IF(ISERR(FIND(D1,A:A)),0,1)*IF(ISERR(FIND(E1,B:B)),0,1))
    and press Ctrl and Shift and Enter to enter as array formula

    I hope it can help you

    Regards,
    Antonio

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Try This

    Try this mate,

    obviously changes the cell ranges as necessary and the criteria for cat, dog etc. but dont press return instead press CTRL+SHIFT+RETURN

    =SUM(($A$1:$A$5="Cat")*($B$1:$B$5="A"))

    I use this function to calculate stuff for data analysisng at work

    Hope it helps

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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