When I run a query, the results of it are exported to the Excel. This data has few hyperlinks which get displayed in random (I don't know which cell or column).
My issue is that the hyperlinks are getting displayed as normal word and not as clickable hyperlinks. Unless, I click on the particular cell and click outside, the hyperlink doesn't become blue. How can I resolve this issue? I want the hyperlinks exported to excel as clickable hyperlinks.
There is a =HYPERLINK() formula in ms's excel and apple's numbers programs.
Two ways to apply this:
In your source data, have that column's output wrapped in the formula.
As you didn't give an example query or mention the language. here's a sql example:
select products_id, products_name,
concat("=HYPERLINK(\"http://www.site.com/product_info.php?products_id=",products_id,"\")"),
products_description from products p;
so the resulting excel/xml column will be =HYPERLINK("http://www.site.com/product_info.php?products_id=1223") and it will be clickable when you open the file in excel.
The other way to handle this is after you open it in excel:
Let's say the links are in column C. Make a new column D, in cell D2 insert the formula
=HYPERLINK(C2) then press enter, click on cell D2, copy, then select the entire column D, paste. Now you have a column of clickable links.
-Z
One of the ways is to show the result of the query in a grid like GridView control and then export the Grid. This will causes the underlying HTML to get exported as well (i.e GridView HTML and all the controls inside the GridView).
After that when you open the Excel file you will see the links intact. Here is an article which talks about exporting GridView to excel.
http://www.highoncoding.com/Articles/197_Extensive_Study_of_GridView_Export_to_Excel.aspx
Related
I want to populate a new column with a specific cell using Power Query exactly like this:
from this -->to this
This task has been taught here: https://exceleratorbi.com.au/convert-a-cell-value-into-a-column-with-power-query/
but I start with a structured table within the worksheet and so the Power Query only reads the table, leaving out the specific cells that I need (which are B2 and B4), as displayed here.
Excel
Query
So how can I do the same thing?
Here is a complete example, starting with a worksheet like this:
Click on the specific cell containing the value with which you want to populate a new column (B2), enter a name in the name box (cellCategory), and press Enter. Right-click the cell and click on Get Data from Table/Range... which opens the Power Query Editor.
Open the Advanced Editor, delete everything, enter this line of code and click on Done:
Excel.CurrentWorkbook(){[Name="cellCategory"]}[Content][Column1]{0}
Named ranges that are loaded in Power Query are automatically transformed to a table. In the line above, [Column1]{0} accesses the value located in Column1 at row index 0 of that table which contains a single cell. So now you have a query that returns the content of that cell.
If your main table isn't yet loaded to Power Query, return to the worksheet, right-click on your table and click on Get Data from Table/Range....
Now, as shown in Step 5 of the linked tutorial, go to the ribbon tab Add Column, click on the button Custom Column, and add a new column named Category filled with the cellCategory query value by entering cellCategory and clicking on OK:
Here is the result:
I want to block certain users/groups from viewing formulas in certain cells in Google sheet, but they'll have permission to edit other cells values. All they will be able to see is the result.
explanation: it's an advanced calculator. let's say that I want to give the user the ability to put values in cells A1 and B1, and in C1 the formula is =A1+B1.
I want to hide the formula in C1, so the user will only the the result.
There's a few ways to do it depending on how/who is working on the sheet. If people aren't familiar with sheets you can actually hide the formula in a row at the top by using array formulas so in the header:
={" header title" ; arrayformula(a2:a+b2:b)}
The formula would be hidden in the cell that shows the header, all the cells below would just be the calculation. If you hide the row that has the arrayformula and protect it no one will be able to see it. The only thing is you have to also protect the column otherwise if someone hardcodes a value in the column the formula will stop working.
The second option (easier but can run into more issues is the have a 'mirror' copy of the sheet they are interacting with in the same file as a hidden sheet. Basically a duplicate of the tab with all the cells a direct reference of the first tab. So:
Sheet1 = tab they interact with
Sheet2 = 'mirror' tab with every cell being ='Sheet1'!a1, but for the corresponding cell value.
As they edit Sheet the values entered in Sheet1 will show up in Sheet2, then the calculations can happen on that sheet, and then Sheet1, can just be a direct reference to that column in Sheet2. So the calculations in Sheet1 will only appear ='Sheet2'!C2. If you protect Sheet2 and hide it no one will be able to see the formulas. Sheet1 could even reference Sheet2 with an index formula like: index(column sheet2,,) which would return the entire column from sheet2.
I have a cross tab. I hide an entire column by setting the style to one containing "display: none". This looks great in html and pdf.
But when exporting to Excel, the column appears with empty values.
How do I force the excel export to not show the column?
Have you tried using the visibility expression for the column instead of the style display:none?
I think setting width to 0 only hide the column (when exporting to excel) when the report Layout is "Fixed Layout".
Unfortunately "Fixed Layout" is a pain to use when you have a crosstab with lots of columns, as Excel starts throwing errors if the width gets too big.
I have a question about making a label by using dropdown list getting multiple column data from other sheet to the specific cell.
my sample file is here
From the "How to" file I have two sheets, sheet 1 is for making dropdown list to get data from sheet2. but i only make dropdown list from data from sheet2!A2:A (dont know how to get all data from multiple columns).What i want is all data from the row of Code (that i select from dropdown list) to show in the specific cell in the box next to it.
Could you please suggest me what formula will work on this case, or what function I should to try. Thanks in advance.
Shawn Penn
In Google Sheets, a cell using a data validated range consisting of hyperlinks will only display the link text and is not an actual link.
Example, I have a google spreadsheet consisting of 2 sheets. Sheet 1 has a cell with data validation getting it's values from a range on sheet 2, like so Sheet2!B2:B50
Sheet 2 cell B2 contains a hyperlink like this:
=hyperlink("https://docs.google.com", "LINK TEXT")
When you select that item back in Sheet 1 in the validated cell, the cell only displays LINK TEXT and is not a hyperlink.
Is there a way to use hyperlinks in a data validated range?
I think, there's still no direct way to do this since you'd asked the question. But it's possible in two ways:
make OnEdit script and replace selected text with
corresponding link
make 2 separate columns and emulate choise.
I want to suggest the second way as it's easier to implement.
The result will look like this:
Here's the link to my test file.
Step 1. Prepare data
So Sheet2 contains data, it should look like this:
Separate:
links in column B
and their labels in column A.
Step 2. Make Data Validation
Go to Sheet1. And in required range make the new rule for Data Validation. In our sample it's column A. So select range > Go to Data > Validation... > select range Sheet2!A2:A100 from your data sheet.
Note that in Google Sheets you may use bigger range for validation, sheets would ignore blanks.
Also there's a good reason to make the result of selection invisible. To make it, select custom number format and use this text:
;;;
Step 2. Make Hyperlinks with formula
In Sheet1, cell B2 paste the formula:
=ArrayFormula(if(A2:A<>"",HYPERLINK(VLOOKUP(A2:A,Sheet2!A:B,2,0),A2:A),""))
It will expand automatically.
That's all!