+ Reply to Thread
Results 1 to 7 of 7

Repeating the values from previous row whe a row is all zeros

  1. #1
    Registered User
    Join Date
    11-10-2021
    Location
    NSW
    MS-Off Ver
    O365
    Posts
    4

    Repeating the values from previous row whe a row is all zeros

    Hi, and thanks for reading.

    I have some assay data that has been delivered with % distributons every 5 metres. The sample interval is every 0.5 m. All the other rows have zeros all the way across. I want to preserve the sample interval so sorting and getting rid of the zero rows does not help.

    I'd like to know how to just repeat the values from the previous row if the row is all zeros.

    I am attaching a small subset of the file.

    Many thanks

    GG
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-19-2019
    Location
    Illinois, USA
    MS-Off Ver
    365
    Posts
    164

    Re: Repeating the values from previous row whe a row is all zeros

    I am not 100% sure that I am understanding what you want -- I looked at your sample file, but it's not giving any context for what the end result should look like. Can you expand a little bit on what the data should look like in the end?

  3. #3
    Registered User
    Join Date
    11-10-2021
    Location
    NSW
    MS-Off Ver
    O365
    Posts
    4

    Re: Repeating the values from previous row whe a row is all zeros

    Sure,
    The rows with all zeros should look the same as the nonzero rows above them until the next nonzero row

    so
    200 50 10 20 20
    200.5 0 0 0 0
    201 0 0 0 0
    201.5 0 0 0 0
    202 0 0 0 0
    202.5 0 0 0 0
    203 0 0 0 0
    203.5 0 0 0 0
    204 0 0 0 0
    204.5 0 0 0 0
    205 80 20 0 0
    205.5 0 0 0 0

    will look like

    200 50 10 20 20
    200.5 50 10 20 20
    201 50 10 20 20
    201.5 50 10 20 20
    202 50 10 20 20
    202.5 50 10 20 20
    203 50 10 20 20
    203.5 50 10 20 20
    204 50 10 20 20
    204.5 50 10 20 20
    205 80 20 0 0
    205.5 80 20 0 0

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Repeating the values from previous row whe a row is all zeros

    Maybe try a formula like this in H2 and drag across and down. Not sure what you want for row 1 as it is already all zeros.

    Please Login or Register  to view this content.
    see attached example
    Attached Files Attached Files
    Happy with my advice? Click on the * reputation button below

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Repeating the values from previous row whe a row is all zeros

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Registered User
    Join Date
    11-10-2021
    Location
    NSW
    MS-Off Ver
    O365
    Posts
    4

    Re: Repeating the values from previous row whe a row is all zeros

    Thanks,

    I don't think it was quite there but changing B2:F2 to $B2:$F2 did the trick.

    Thanks again for the help

  7. #7
    Registered User
    Join Date
    11-10-2021
    Location
    NSW
    MS-Off Ver
    O365
    Posts
    4

    Re: Repeating the values from previous row whe a row is all zeros

    Wow,
    I know almost nothing about macrros in Excel but I will make a point of understanding how to implement and modify this for other similar problems.

    Many thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Incrementing numbers based on previous values and text values of a previous cell
    By mauricewsylvester in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2021, 12:34 PM
  2. Replies: 3
    Last Post: 11-09-2020, 09:15 AM
  3. [SOLVED] How to find non-repeating values in Column B for repeating values in Column A
    By jdegeorge in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-16-2017, 01:43 PM
  4. Replies: 2
    Last Post: 05-17-2016, 11:17 AM
  5. Replies: 0
    Last Post: 09-13-2013, 10:13 AM
  6. Replies: 0
    Last Post: 10-14-2011, 12:09 PM
  7. creating a repeating formula that doesn't show repeating values
    By cybershot in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-09-2010, 06:12 PM

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