+ Reply to Thread
Results 1 to 6 of 6

Use formula in place of row number?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Use formula in place of row number?

    I need to come up with a way to determine the appropriate range for a countif function. The column is known and unchanging, the row number depends on how many items there were in the previous category.

    For example: I would need to count a variable in column C from rows 3-5 shown below, because they are all in the same category (2). Number of rows in each category varies greatly. Tried using nested if functions but that doesn't scale.

    1 1
    2 1
    3 2
    4 2
    5 2
    6 3

    ideally, would use something like =countif(C"match(...):C"match(...),1) but can't figure out how to or if I can use the match function in place of the row number.

    Appreciate your thoughts.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Use formula in place of row number?

    How about this in C1, then copied down:

    =COUNTIF($B$1:$B1, $B1)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-08-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Use formula in place of row number?

    I should have clarified...the book has 2 sheets. im analysing news coverage for the appearance of certain terms. in one sheet, each row is a particular instance of a term, with a number of columns for different classifications. in another sheet, i need to have totals for each classification by article. trouble is, each article has a different number of terms.

    ie

    1 article 1 term 1
    2 article 1 term 2
    3 article 1 term 3
    4 article 2 term 1
    5 article 3 term 2
    6 article 3 term 2

    I need to count how many times term 1 appears in each article, etc. The term sheet will be pretty extensive so I'd rather not do it by hand for each article

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Use formula in place of row number?

    Hello,

    this would be much easier to understand and solve if you could post a workbook instead of entering sample data in a post. Mock up a few rows of data and manually enter expected results.

  5. #5
    Registered User
    Join Date
    05-08-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Use formula in place of row number?

    Good call. Heres an example of what i'd like to be able to do. The term sheet contains entries for every occurrence of particular terms. Article sheet counts the terms by articles. There are a number of other data points for each entry in the term sheet but the mechanics are the same. There will ultimately be hundreds of entries in the term sheet and probably about 50 articles. Problem with the countif( function is caused by the variable ranges for each article (since the number of relevant terms in each article varies significantly). Open to any suggestions. Thanks in advance.
    Attached Files Attached Files

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Use formula in place of row number?

    You could create a pivot table. See attached. To get started with pivot tables, take a look at http://peltiertech.com/Excel/Pivots/pivotstart.htm

    cheers,
    Attached Files Attached Files

+ 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