+ Reply to Thread
Results 1 to 3 of 3

Skip hidden rows with offset

  1. #1
    Registered User
    Join Date
    03-08-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Skip hidden rows with offset

    I have attached a sheet which is a much simplified version of the issue I am having.

    For the presentation of a report, I want alternate groups coloured differently, and each group consists of two rows. I have set up the values in column B as an OFFSET from the reference points in rows 1-4 (and associated conditional formatting to them) so that I can insert extra two-row groups and maintain the red-red/blue-blue pattern throughout the list.

    The problem I have arises when you filter column A. For the purposes of the report I want to maintain the red-red/blue-blue pattern throughout, but as you can see this does not work as the OFFSET function recognises hidden rows.

    So what I want to know is: is there a way to use OFFSET so that it ignores hidden rows and only looks for the specified reference from visible rows?

    I have searched the web and found a couple of solutions that require using a loop through VBA script, but I am trying to avoid this as the actual document I need this for is 1000+ rows grouped into 5 sectors and loops on it take an age.

    Thanks in advance for any help...
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Skip hidden rows with offset

    Not entirely sure I follow but one formula based route would be to make use of a "lightweight" helper column to ease calculation burden - eg:

    C5: =SUM($C4,SUBTOTAL(3,$A5))
    copied down for all rows

    Then

    B5: =INDEX($B$1:$B$4,1+MOD($C5-1,4))
    copied down for all rows


    As you filter based on Col A you should find your desired formatting persists.

  3. #3
    Registered User
    Join Date
    03-08-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Skip hidden rows with offset

    Quote Originally Posted by DonkeyOte View Post
    Not entirely sure I follow
    Sorry, tried to put together a small snapshot of a much larger project to demonstrate the problem and it looks a bit pointless.

    I have used your soloution in the main project and it works perfectly and quickly. Learned a couple of new bits there. Thanks very much, you are thankfully not Quixotic in response!

+ 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