o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
"=INDEX(SPLIT(IMPORTHTML("https://www.equitymaster.com/share-price/SG25/SGBJUN31-800580/S…
- User
"=INDEX(SPLIT(IMPORTHTML("https://www.equitymaster.com/share-price/SG25/SGBJUN31-800580/SOVEREIGN-GOLD-BOND-25-JUNE-2031-S1-Share-Price","table",7), "*"), {3, 10}) "
this is giving output "% Change -0.66"
but I want "% Change -0.66%"
- Assistant
To display the "% Change" value with a "%" at the end, you can modify your formula to concatenate a "%" symbol to the second value. Here's how you can adjust your formula:
plaintext=ARRAYFORMULA(INDEX(SPLIT(IMPORTHTML("https://www.equitymaster.com/share-price/SG25/SGBJUN31-800580/SOVEREIGN-GOLD-BOND-25-JUNE-2031-S1-Share-Price","table",7), "*"), {3,10}) & {"","%"})Explanation:
- INDEX Function: Retrieves the specific elements you want from the split data.
{3,10}means you are getting the 3rd and 10th elements. - SPLIT Function: Splits the imported HTML table data at the asterisk
"*". - IMPORTHTML Function: Imports the 7th table from the specified URL.
- ARRAYFORMULA: Allows you to apply an operation to an array of cells.
- The part means you are adding nothing () to the first element (so it remains as "% Change") and adding to the second element (so "-0.66" becomes "-0.66%").
- INDEX Function: Retrieves the specific elements you want from the split data.