+ Reply to Thread
Results 1 to 1 of 1

Insert row pieces

  1. #1
    Registered User
    Join Date
    05-11-2016
    Location
    Hungary
    MS-Off Ver
    Office 2010
    Posts
    11

    Insert row pieces

    Hi Guys!

    I have a 2015 related workbook, it looks like this:
    A B C D E G H
    New York Yes Yes Cost1 10
    New York Yes Yes Cost2 10
    New York Yes Yes Result 20
    London No No Cost1 5
    London No No Cost2 4
    London No No Cost3 4
    London No No Result 13

    The structure is:
    there are city rows, after the last city row there is an extra row called result row that is similar to the previous one but calculates the sum of the last two columns.
    The D column us the cost type, it is important.

    I have a range object or table that I get from 2016 related workbook that looks like this:
    X Y Z
    New York Cost1 2
    New York Cost2 1
    New York Result 3
    London Cost5 14
    London Result 14

    The task is to insert the second table into the first one. If the cost type is exists for the city then insert it into the same row. If not, create new row and insert into that.

    A B C D E G H
    New York Yes Yes Cost1 10 2
    New York Yes Yes Cost2 10 1
    New York Yes Yes Result 20 Result 3
    London No No Cost1 5
    London No No Cost2 4
    London No No Cost3 4
    London No No Cost5 14
    London No No Result 13 Result 14


    So Cost1, Cost2 were existed in case of New York, so the 2 values were inserted into the same row into H
    Cost5 was not existed in case of London, so a new row was created. As you can see A, B , C, D inherited the values, E is empty because this cost was not existed, and the new value goes into H.

    Thanks in advance!!
    Last edited by std51; 05-11-2016 at 01:29 PM.

+ 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. Please explain the pieces of this code
    By freshfruit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2014, 09:22 PM
  2. Looking up several pieces of data
    By darylpaskell in forum Excel General
    Replies: 0
    Last Post: 10-16-2013, 11:50 AM
  3. [SOLVED] Looking up a value based on two pieces of information
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-11-2013, 03:48 PM
  4. Replies: 1
    Last Post: 09-20-2011, 02:37 PM
  5. Parsing into three pieces
    By Viewson in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-26-2011, 06:18 AM
  6. Hash (#) Key and other function pieces
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2006, 07:23 PM
  7. Finding pieces of a value in a table
    By root in forum Excel General
    Replies: 6
    Last Post: 07-21-2006, 01:31 PM
  8. how do i get a set of pieces from a given # with standard lengths
    By sseguine in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2005, 09:40 AM

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