+ Reply to Thread
Results 1 to 6 of 6

Count value occurences accross columns and rows

  1. #1
    Registered User
    Join Date
    11-16-2013
    Location
    Aledo, TX
    MS-Off Ver
    Excel 2010
    Posts
    7

    Count value occurences accross columns and rows

    Hello,

    Is there a quick way to list each value and the number of corresponding occurences accross rows and columns? For example, the output for the list below would be:

    curtis 4
    frank 3
    .
    0 1 2 3
    0 curtis jake jim frank
    1 frank jon jack curtis
    2 jon jake jim frank
    3 jim curtis jack curtis

    I would use a pivot table if all the values were in one column. Thank you.

    Dustin

  2. #2
    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,936

    Re: Count value occurences accross columns and rows

    Hi and welcome to the forum

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count value occurences accross columns and rows

    Try this...


    Data Range
    A
    B
    C
    D
    E
    F
    G
    2
    curtis
    jake
    jim
    frank
    -----
    frank
    3
    3
    frank
    jon
    jack
    curtis
    jim
    3
    4
    jon
    jake
    jim
    frank
    jake
    2
    5
    jim
    curtis
    jack
    curtis
    curtis
    4
    6
    jack
    2
    7
    jon
    2
    8


    Enter this array formula** in F2:

    =IFERROR(LOOKUP("zzz",INDEX(IF(COUNTIF(F$1:F1,A$2:D$5),0,A$2:D$5),MIN(IF(COUNTIF(F$1:F1,A$2:D$5),"",ROW(A$2:D$5)-ROW(A$2)+1)),0)),"")

    Note that the formula refers to cell F1. It is assumed cell F1 is a column header and that cell must not contain a name that is also in the data range A2:D5.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Enter this formula in G2:

    =IF(F2="","",COUNTIF(A$2:D$5,F2))

    Select F2:G2 and copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    11-16-2013
    Location
    Aledo, TX
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Count value occurences accross columns and rows

    Tony,
    Thank you for the clever formula which works perfectly. I appreciate your help.
    Dustin

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Count value occurences accross columns and rows

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count value occurences accross columns and rows

    You're welcome. Thanks for the feedback!

+ 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. [SOLVED] count the number of text occurences on the refered rows
    By Jul Stev in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 07:58 AM
  2. Count Number of occurences Across Columns based on Similar Column Headers
    By vidyuthrajesh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-27-2013, 06:42 PM
  3. Count occurences btwn two different values across two columns
    By MMALD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2012, 06:15 PM
  4. Replies: 8
    Last Post: 01-19-2012, 07:53 AM
  5. Count frequency of occurences in rows
    By markos97 in forum Excel General
    Replies: 2
    Last Post: 07-29-2010, 05:00 AM

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