+ Reply to Thread
Results 1 to 6 of 6

Row to Columns with COUNTIF

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    45

    Row to Columns with COUNTIF

    I have a function set up on SheetA to count the number of cells with "X" in them on a SheetB: COUNTIF(SheetB!$B$3:$B$50,"X"). I have several additional training types listed on SheetA which are identical to row B on SheetB, but they are layed out as a column on SheetA. In other words, B2:AJ2 on SheetB is the same as A2:A36 on SheetA. I want to be able to drag down my COUNTIF formula on SheetA and have it count the relevant columns to the right in SheetB. I've tried various combinations of INDEX and MATCH which I think is the key here, but I can't seem to make it work within an array. Any thoughts on how I can accomplish this? Thanks in advance for any assistance.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Row to Columns with COUNTIF

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    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,938

    Re: Row to Columns with COUNTIF

    It might be easier to offer suggestions if we could see a sample (workbook) of what you are working with?
    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

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Row to Columns with COUNTIF

    =COUNTIF(INDEX(sheetb!$B$3:$AJ$50,,ROWS($A$1:A1)),"x") filled down will reference columns b through aj
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    07-19-2013
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Row to Columns with COUNTIF

    martindwilson, that formula nailed it! Thanks for the help! I was very close to what you came up with, but didn't realize I could use the double comma to leave out the row argument like you did so that the ROWS function provides the column number. Very crafty!

  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: Row to Columns with COUNTIF

    Omitting the ROW argument causes it to be evaluated as 0 which means "all rows".
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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: 2
    Last Post: 04-18-2013, 02:03 PM
  2. Countif in two columns ?
    By lop__ in forum Excel General
    Replies: 4
    Last Post: 04-05-2010, 02:14 PM
  3. Countif different columns
    By windme in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-04-2009, 07:29 AM
  4. COUNTIF On Two Columns
    By SamuelT in forum Excel General
    Replies: 5
    Last Post: 11-23-2006, 10:23 AM
  5. Help with countif using two columns
    By Vipulparbat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-17-2006, 09:05 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