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!!
Bookmarks