Closed Thread
Results 1 to 4 of 4

If cell is 0, INDEX next row

  1. #1
    Registered User
    Join Date
    09-07-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    If cell is 0, INDEX next row

    I'm listing my defined data 'allhazards' (50 rows x 8 columns) and there are 0's in cells where no data is entered.

    I'm converting the 50 rows x 8 columns into 400 rows x 1 column using this formula:
    =INDEX(allhazards,1+INT((ROW($A1)-1)/COLUMNS(allhazards)),MOD(ROW($A1)-1+COLUMNS(allhazards),COLUMNS(allhazards))+1)

    How do I modify it to NOT reference the 0's? I.e. if cell is 0, move to next row, keep doing this until no rows are left

    eg. (3 rows x 8 columns)
    row1col1 row1col2 row1col3 row1col4 row1col5 row1col6 0 0
    row2col1 row2col2 0 0 0 0 0 0
    row3col1 0 0 0 0 0 0 0

    would turn into this:
    row1col1
    row1col2
    row1col3
    row1col5
    row1col6
    row2col1
    row2col2
    row3col1

    without the cells containing zeroes

    Any ideas? Thanks in advance for your help
    Last edited by jlea94; 09-07-2015 at 09:17 PM.

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: If cell is 0, INDEX next row

    Cross-post;http://www.mrexcel.com/forum/excel-q...ext-index.html
    Please click the * Add Reputation if this helps
    If solved remember to mark Thread as solved

    "I'm glad to help and this is not meant to sound smart, but either you have super-human vision to see all those controls cleared one by one with the code I posted, or your computer is really slow."

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: If cell is 0, INDEX next row

    Welcome to the forum

    Please read the forum rules regarding cross-posting.

    Reading your thread, I am tempted to suggest that you just filter on zero, and then just delete those rows?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: If cell is 0, INDEX next row

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    http://www.excelforum.com/excel-form...-of-cells.html

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Returning Multiple Values via Index Match that are < cell and = to another cell
    By covanpatten2 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-21-2015, 10:08 AM
  2. [SOLVED] Post a value in a cell based off the value of an index cell?
    By CPcel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-20-2015, 08:52 PM
  3. Return Row Index and Column Index of a Cell in a Range
    By exceere in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-06-2015, 04:54 AM
  4. Count if - cell color index & cell value (range of value)
    By PENGUIN88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 12:17 AM
  5. [SOLVED] Index Match from a cell populated from index match
    By MarcLewis in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-15-2013, 05:30 AM
  6. How to find cell value along with cell color when we use Index formula?
    By Kulbir in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2012, 01:45 PM
  7. Submit data to Sheet2 cell based on index value in cell
    By mondo_ray in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-13-2011, 07:57 PM

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