+ Reply to Thread
Results 1 to 3 of 3

Sorting data containing COUNTIF formulas

  1. #1
    Registered User
    Join Date
    10-26-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Sorting data containing COUNTIF formulas

    Hi,

    I have COUNTIF fomulas on a spreadsheet that reference table arrays on another sheet. The criteria is just referencing cells. I.e. Column A contains ID numbers and I want to count how many times each ID number appears on the second sheet. So for example, cell A1 has a reference, say "ABC1" and cell B1 has =COUNTIF(Sheet2!$A$1:$A$100,A1).

    If I copy B1 down I get the desired result.

    But...when I sort on the column containing the COUNTIFs something crazy is happening to the formulas...in that it doesn't sort on the output of the COUNTIF to show 0,0,0,1,1,1,2,3, etc as intended. Instead, my COUNTIF's start referencing cells in different rows so the formula in B1 would read =COUNTIF(Sheet2!$A$1:$A$100,A97)....and row 1 in my sheet would be counting how many times the reference in A97 appears in the other sheet?????

    I hope that makes sense! Any ideas how I get round this?

    Many thanks

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

    Re: Sorting data containing COUNTIF formulas

    try
    =COUNTIF(Sheet2!$A$1:$A$100,INDEX(A:A,ROW()))
    "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

  3. #3
    Registered User
    Join Date
    10-26-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Sorting data containing COUNTIF formulas

    Thanks Martin, it works!

+ 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