+ Reply to Thread
Results 1 to 6 of 6

Thread: Omit cells based on variable row number

  1. #1
    Registered User
    Join Date
    01-16-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    19

    Omit cells based on variable row number

    The whole problem is discribed in the file along with an example.

    Omit certain cells.xlsx
    Last edited by Steffen_DK; 02-07-2012 at 05:46 PM.

  2. #2
    Registered User
    Join Date
    01-16-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Omit cells based on variable row number

    Bump no response

  3. #3
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,590

    Re: Omit cells based on variable row number

    Not to clear as to what you are aiming for.

    Try this in M3
    =COUNTIF(INDEX(A:A,$J$2,1):INDEX(INDEX(A:A,$J$2,1):INDEX(A:A,$J$3,1),MATCH(99^99,INDEX(A:A,$J$2,1):INDEX(A:A,$J$3,1),1)-1,1),$L3)
    Drag Across to Column Q, then down as required.

    Does that do as you wish?
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  4. #4
    Registered User
    Join Date
    01-16-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Omit cells based on variable row number

    It's almost perfect.
    Except, when choosing Endrow=40, the last numbers in each column should be included: 8, 2, 9, 10 and 4. As long as Endrow is on or beyond an #N/A, the number preceeding that cell should be included.

    Or if Endrow= 38, then 8, 2 and 9 (from A, B, C) should be included, but not 10 and 4 (from D, E)

    Though if this is much complicated, I think it will be possible to change all my #N/A to 0s, that seems to do the trick too. However I'll have to change the function that creates the "Source" values.

  5. #5
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,590

    Re: Omit cells based on variable row number

    Or maybe try this

    =COUNTIF(INDEX(A:A,$J$2,1):INDEX(INDEX(A:A,$J$2,1):INDEX(A:A,$J$3,1),MAX(MATCH(99^99,INDEX(A:A,$J$2,1):INDEX(A:A,$J$3,1),1),MATCH(REPT("z",255),INDEX(A:A,$J$2,1):INDEX(A:A,$J$3,1),1))-1,1),$L3)
    [Edit]
    On second thoughts, that won't work.
    Easiest to return 0 (zero) instead of #N/A if you can.
    Last edited by Marcol; 02-07-2012 at 10:17 AM.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  6. #6
    Registered User
    Join Date
    01-16-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Omit cells based on variable row number

    Ok, I added
    IFERROR(... ;0)
    to all the source formulas. Took my pc 8 minutes for the 41000 cells, but it was well worth it, and getting rid of the N/A also helped on some other formulas that had trouble with those

    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.2.0