+ Reply to Thread
Results 1 to 4 of 4

Move/collect values to into one row

  1. #1
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Move/collect values to into one row

    Hi all,

    Move values scattered in between empty cells between two lines into the top line of those two lines:

    Udklip.JPG

    The goal is to have the formula count the empty cells between the two order line and offset the values into line of the order it self.

    Hope it makes sense?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: Move/collect values to into one row

    The attached uses an array-entered formula, so if you need to make changes to the formula you need to enter it using Ctrl-Shift-Enter.
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Re: Move/collect values to into one row

    Awesome. Thank you very much.

    If you have time, can you break down how it works? I'm trying improve my excel-skills. Thanks

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: Move/collect values to into one row

    The array-formula that I used in C2 is this:

    =SUM(OFFSET(C3,0,0,MIN(IF($B3:$B$17="",ROW($B3:$B$17)))-ROW()-1,1))

    When it is copied to the next set of headers (starting in C8), it becomes

    =SUM(OFFSET(C9,0,0,MIN(IF($B9:$B$17="",ROW($B9:$B$17)))-ROW()-1,1))

    Basically, the important part is this array MIN(IF($B3:$B$17="",ROW($B3:$B$17))) which finds the number of the first row below B3 that is empty. Then by subtracting the ROW() of the formula (2) and an additional 1, we get the size of the possible values beneath the header (but before the next), which is used with OFFSET to find the sum of those numbers.

+ 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. Collect rows with specific values and then comiple
    By Cooltrain in forum Excel General
    Replies: 14
    Last Post: 07-18-2016, 08:39 PM
  2. Collect cell values in 3 cells from certain worksheets
    By rosshkerr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2016, 03:29 PM
  3. [SOLVED] Collect Unique Values from area
    By filkod in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-16-2016, 09:13 PM
  4. Replies: 3
    Last Post: 01-26-2016, 08:28 PM
  5. Replies: 1
    Last Post: 04-19-2012, 11:43 AM
  6. Macro to collect average values
    By bigband1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2011, 08:01 PM
  7. How do you collect and move pictures around using macros?
    By iterature in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2007, 10:07 AM

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