+ Reply to Thread
Results 1 to 6 of 6

Dynamic Range using Offset and CountIF

  1. #1
    Registered User
    Join Date
    06-12-2008
    Posts
    11

    Question Dynamic Range using Offset and CountIF

    I have a data set that alters each week which means at the moment I have to update the ranges manually each time.

    I would like to use a dynamic range and think I need to use the Offset and CountIf functions.

    Both the start and end of the ranges are dynamic.

    The range is based on grouping the numbers in Column E (LocNo)


    What I would like to do or think the way to achieve this is by:

    First looking at Column E

    Count how many cells are equal to criteria. (CountIf)

    offset 5 columns left from the first cell that meets the criteria (Offset -5)

    offset X rows down based on how many cells meet the criteria (Offset X)


    I've include a spreadsheet spread sheet which 'should' help illustrate the problem showing the ranges I would like and how the data changes each week.

    any help would be much appreciated!
    Attached Files Attached Files
    Last edited by mark_jam3s; 12-04-2008 at 11:48 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902
    Are you just trying to show the covered range in column O?

    If so... here are a couple of alternatives:

    in O5 enter:

    Please Login or Register  to view this content.
    and confirm it with CTRL+SHIFT+ENTER not just ENTER...You will see {} brackets appear.

    Then copy this formula to the other cells of interest.

    Or..

    in O5:

    Please Login or Register  to view this content.
    This is entered normally, with just ENTER.
    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.

  3. #3
    Registered User
    Join Date
    06-12-2008
    Posts
    11
    Thanks for getting back so quick.

    The example I've given is more of a visual representation of what I'm after.

    Week 1 and 2 is to show how the data would change from each week.

    The colour shaded cells are just to show the ranges I would like to select.


    I'm trying to enter the formula using Insert\Name\Define then type the formula in 'Refers to:'

    All the Ranges will already be named.

    I've just been working on the following and donít think Iím far off using something like:

    Please Login or Register  to view this content.

    or

    Please Login or Register  to view this content.

    I'm selecting the correct size of the range using the above but need the range shifting down.

    The above example is using Ď2í to group the range by.

  4. #4
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671
    You where close. Use this:

    Range1 =OFFSET(Sheet1!$A$4,0,0,COUNTIF(Sheet1!$E$4:$E$21,1),5)
    Index(Range1,1,1) is the top left cell of A4:E8.

    I've attached you origional. Do the Range2:Range4 yourself!
    Attached Files Attached Files
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902
    Try this for defined range for activating LocNo 2:

    Please Login or Register  to view this content.
    change the "2" in the Match and Countif function for your other named ranges

  6. #6
    Registered User
    Join Date
    06-12-2008
    Posts
    11
    Thanks for your help!

    This has saved me a lot of time!

+ 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