+ Reply to Thread
Results 1 to 9 of 9

Use a formula to dynamically populate the row value of a range.

  1. #1
    Registered User
    Join Date
    08-23-2017
    Location
    UK
    MS-Off Ver
    8.1
    Posts
    4

    Use a formula to dynamically populate the row value of a range.

    Hi All,

    I'm trying to create a formula that allows the range values to be dynamic based on a MATCH formula returning a value.

    Here is my example:

    =COUNTIF(A1:A&(MATCH("NAME",B:B,0)),"countifcriteria")

    I would like the range for the COUNTIF to change so it could be A1:A10 or A1:A1000 depending on the result of the MATCH formula.


    Any help would be great as I can't think of a way around this one.
    Last edited by thejrose; 08-23-2017 at 10:01 AM. Reason: Increase relevance of title

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a formula to dynamically populate the row value of a range.

    Try

    =COUNTIF(A1:INDEX(A:A,MATCH("NAME",B:B,0)),"countifcriteria")

  3. #3
    Registered User
    Join Date
    08-23-2017
    Location
    UK
    MS-Off Ver
    8.1
    Posts
    4

    Re: Use a formula to dynamically populate the row value of a range.

    Hi Jonmo1,

    Thanks for the reply.
    The reason I had used just MATCH is that I want the range reference to be the same of the row of the matching criteria.
    Using INDEX/MATCH wouldn't give me that.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a formula to dynamically populate the row value of a range.

    Did you Try it?

  5. #5
    Registered User
    Join Date
    08-23-2017
    Location
    UK
    MS-Off Ver
    8.1
    Posts
    4

    Re: Use a formula to dynamically populate the row value of a range.

    Yes, but the INDEX would return a value in column A, other than the row of the criteria.

    Another option would be to add an additional column of data with numbers incrementing for each row?

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a formula to dynamically populate the row value of a range.

    No, the Index returns a Range Object.

    If "Name" is found in say B20, then it goes like this

    =COUNTIF(A1:INDEX(A:A,MATCH("NAME",B:B,0)),"countifcriteria")
    =COUNTIF(A1:INDEX(A:A,20),"countifcriteria")
    A20 is the 20th cell in A:A, so Index returns the Range Object A20
    =COUNTIF(A1:A20,"countifcriteria")
    Last edited by Jonmo1; 08-23-2017 at 10:50 AM.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a formula to dynamically populate the row value of a range.

    Meant to say A20 there

    A20 is the 20th cell in A:A, so Index returns the Range Object A20

  8. #8
    Registered User
    Join Date
    08-23-2017
    Location
    UK
    MS-Off Ver
    8.1
    Posts
    4

    Re: Use a formula to dynamically populate the row value of a range.

    That's now working!

    Thank you for your help.

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a formula to dynamically populate the row value of a range.

    You're welcome.

+ 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] Formula needed to auto populate in a range of cells on mult sprdsheets based on text input
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-31-2015, 06:40 PM
  2. [SOLVED] Formula or function to populate a range of cells based on "TODAY()"?
    By Bonzopookie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-29-2014, 05:59 PM
  3. auto populate a formula for rolling range of cells
    By rbtfinley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2014, 08:54 PM
  4. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2014, 07:42 PM
  5. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  6. Replies: 2
    Last Post: 01-26-2011, 05:56 PM
  7. Replies: 2
    Last Post: 01-26-2011, 11:16 AM

Tags for this Thread

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