+ Reply to Thread
Results 1 to 8 of 8

Dynamic Named Range, COUNTIFs & VLookups

  1. #1
    Registered User
    Join Date
    05-20-2009
    Location
    uk
    MS-Off Ver
    Excel 2002
    Posts
    23

    Dynamic Named Range, COUNTIFs & VLookups

    Hi,

    Am after some help with the formula below - I want to use it to create a dynamic named range in Column R and use VLookup to match the month value (in this case March i.e. 3) in the named range 'Range_Month' which is a 2 column dynamic named range in Cols A &B (the month numerical value is in Col 1/A) - the end result being that I can create multiple dynamic ranges in the Col R for the month to which it corresponds.

    I'm not sure what's missing/incorrect for it not to be working...help much apreciated!!

    Name: Range_Profit_03

    Formula: =OFFSET($R$2,1,0,COUNTIF(VLOOKUP(3,Range_Month,1,TRUE),$R:$R))

    Thanks!
    Last edited by pmd; 05-31-2010 at 08:58 AM.

  2. #2
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Dynamic Named Range, COUNTIFs & VLookups

    Could you post an example workbook? It would make what you are trying to achieve clearer.

    On a side note, the COUNTIF syntax is incorrect. It should be:

    =COUNTIF(range, criteria)

    e.g. =COUNTIF(Range_Month,3)
    Last edited by pb71; 05-30-2010 at 12:02 PM.

  3. #3
    Registered User
    Join Date
    05-20-2009
    Location
    uk
    MS-Off Ver
    Excel 2002
    Posts
    23

    Re: Dynamic Named Range, COUNTIFs & VLookups

    Ok - thanks - see the attached.

    The named range I'm using is actually called in 'Range_RiskTicks_03' (Col R) but the desired effect is still the same (in Col R) and to refer to the month of March in Col B (Range_Month), Range_RiskTicks_04 for April, Range_RiskTicks_05 for May etc.

    If you look on the Report tab you'll see there's an averageif function that uses the dynamic Range_RiskTicks_03 range as the source data for each month.

    Thanks...and hope it makes sense
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-20-2009
    Location
    uk
    MS-Off Ver
    Excel 2002
    Posts
    23

    Re: Dynamic Named Range, COUNTIFs & VLookups

    Polite bump!

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

    Re: Dynamic Named Range, COUNTIFs & VLookups

    I don't get how you are using the Vlookup to determine your range size.

    If I lookup 3 in Range_Month, I get 3. Does that mean you want your range to be a size of 3 cells? Please clarify.
    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.

  6. #6
    Registered User
    Join Date
    05-20-2009
    Location
    uk
    MS-Off Ver
    Excel 2002
    Posts
    23

    Re: Dynamic Named Range, COUNTIFs & VLookups

    I want to match the cells in Column R that have a corresponding value of 3 in Col B i.e. Range_Month

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

    Re: Dynamic Named Range, COUNTIFs & VLookups

    Still not 100% clear..

    This maybe?

    =OFFSET('Trading Log'!$R$2,1,0,MATCH(3,INDEX(Range_Month,0,1),1))

    it will only highlight the 55 in this sample case.

    It will highlight from row 3 to wherever the month number matches in corresponding column B.

  8. #8
    Registered User
    Join Date
    05-20-2009
    Location
    uk
    MS-Off Ver
    Excel 2002
    Posts
    23

    Re: Dynamic Named Range, COUNTIFs & VLookups

    Perfect - thanks! I was confusing the use of VLookup! Much appreciated!

+ 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