+ Reply to Thread
Results 1 to 5 of 5

Dynamic row in function

  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Dynamic row in function

    I have the following formula in Sheet1 B3:

    =COUNTIF(Sheet2!B2:F2,Sheet1!A1)

    What I would like is for the Sheet2!B2:F2 reference to be dynamic. I want the formula in cell B3 to go and count all the occurences of what is entered in cell A1, but only for the row with the heading 'boat' (or whatever is listed beside the cell).

    I hope that makes sense. The spreadsheet is attached for your reference.

    Thanks a ton!
    Attached Files Attached Files
    Last edited by papaexcel; 07-22-2010 at 12:18 PM.

  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: Dynamic row in function

    nope! what are you actually counting? showing an example that only results in 1 isnt very clear
    "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
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Dynamic row in function

    I'm counting the number of occurences of whatever is in cell A1 for .

    I've updated the spreadsheet. Hopefully it's a little more understandable.

    Thanks again!
    Attached Files Attached Files
    Last edited by papaexcel; 07-22-2010 at 11:44 AM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Dynamic row in function

    try in B2:

    =SUMPRODUCT((Sheet2!$A$1:$A$3=$A2)*(Sheet2!$B$1:$F$3=$A$1))

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Dynamic row in function

    Works great. Thank you.

+ 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