ImportXML returning multiple cells instead of one

CaptainCsaba

Board Regular
Joined
Dec 8, 2017
Messages
78
Hi!

I am trying to get a path in the online Excel on Google Drive. Basically what i am trying to do is for it to return the ISIN code for a certain company on the London Stock Exchange Website. I am trying to do this for all of them and I am really close but can't seem to find the last part. This is what my code looks like (this is for the company "Ashmore group plc"):

Code:
[COLOR=black][FONT=Inconsolata]=[/FONT][/COLOR][COLOR=black][FONT=Inconsolata]importxml[/FONT][/COLOR][COLOR=black][FONT=Inconsolata]([/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"https://www.londonstockexchange.com/exchange/prices-and-markets/stocks/summary/company-summary/GB00B132NW22GBGBXSTMM.html?lang=en"[/FONT][/COLOR][COLOR=black][FONT=Inconsolata],[/FONT][/COLOR][COLOR=black][FONT=Inconsolata] [/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"//div[@id='pi-colonna2']//div[@class='table-responsive']//table[@summary='Trading Information']//td[@class='name']"[/FONT][/COLOR][COLOR=black][FONT=Inconsolata])[/FONT][/COLOR]

This returns the ISIN code but also 22 other cells because there are multiple "name classes" under the "Trading Information Table". So my question is how can I get only the one I want? Is there a way to tell it that only return the 16th thing it finds? Maybe what could be better if I could tell it to only return the thing that contains the substring "GB00" since every ISIN code starts with that and I would like to use this for multiple companies.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
By the way I know That I could use this code and get the ISIN code itself, but this way we would always have to change the code and manually add the current ISIn always, which defeats the purpose:

Code:
[COLOR=#000000][FONT=Inconsolata]=[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]importxml[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"https://www.londonstockexchange.com/exchange/prices-and-markets/stocks/summary/company-summary/GB00B132NW22GBGBXSTMM.html?lang=en"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"//div[@id='pi-colonna2']//div[@class='table-responsive']//table[@summary='Trading Information']//td[text()='GB00B132NW22']"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,490
Messages
6,125,096
Members
449,205
Latest member
ralemanygarcia

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