Returning an Excel expression from a SQL query used in Excel -


i have excel spreadsheet data loaded sql server database using query. query complicated simplicifation:

select     collections.id collectionid,     '=some_excel_function(a' + cast(row_number() over(order pagingid desc) varchar) + ')' computedresult collections 

the query return rows this:

guid_1, =some_excel_function(a1)
guid_2, =some_excel_function(a2)
guid_3, =some_excel_function(a3)
guid_4, =some_excel_function(a4)
...

which does.

then want values displayed excel result of running function some_excel_function on specified column, e.g. forth row second column in excel spreadsheet should show value resulting some_excel_function(guid_4)

but doesn't. instead shows text =some_excel_function(a4).

how nudge excel treating strings returned sql start = expressions , not values , calculating them?

(n.b. have deliberately chosen fictitious excel function some_excel_function highlight different question this one, i.e. cannot replicate excel function within sql query suggested here.)

once have data loaded, have excel re-read text formula.

there 2 options:

  1. (absurdly long) edit each cell, , press enter recalculate

  2. (much quicker) search , replace = =
    yes, it's same character, changing cell, forces excel reevaluate cell

depending on how data presented, may 1 off, or may need repeated every time data refreshed.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -