Scraping data from XML – parent vs sub entries

OggyMan

New Member
Joined
Aug 8, 2015
Messages
2
Hello folks,

First thing first, it's really nice to be a member in your community. Found it the other day googling some excel questions.
Kudos to everyone who chose to be of help for other people! :)

Okay. I'm trying to scrape data from XML files. There's an image below for your convenience.


  1. I've got hunderds of entries in the "name" column.
  2. Some of them are parent-entries, some of them are sub-entries.
  3. The "id" column indicates which kind of entry it is: either parent-entry or sub-entry.
  4. Sub-entries always follow their parent-entries (in other words they'll be always in the rows below the parent's row)
  5. All of the parent-entries read 1 (in the "id" column).
  6. All of the sub-entries read a (whole) number greater than 1 (in the "id" column).
    If there are more than one sub-entry the next rows, they'll read a sequential (endless) number.

I need your kind help to make my Excel (2013) do this automatically:
Copying the "name" cell of sub-entry to a new "see also" column, in the same row as its specific parent-entry.
If there are many of them (sub-entries) – the code will put them in the same cell next to each other: A, B, C ... (seperated by comma/s).

Please condider the following:

  1. Since I've got a table with an unfixed number of columns, I would like it to locate the involved columns ("id" & "name") by finding their name (and not their "x" and "y" location).
  2. I would prefer it was done using a formula (since I'm much more familiar with formulas rather than VBA codes), but it's up to you, especially if using formulas makes it much more complex or difficult.

That's how it looks like (a "slim" version for your convenience):



THANK YOU IN ADVANCE!
I hope I was clear enough and put it well.
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,216,082
Messages
6,128,709
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top