Link to home
Start Free TrialLog in
Avatar of Member_2_7966563
Member_2_7966563

asked on

Excel External Data (numerical) shows up as text

I have a link in an Excel spreadsheet to get external data from an MS Access database, containing a query. This query produces some fields containing numerical values.

But when the data is downloaded into Excel, it is treated as text with zero value. If I calculate another cell using these values, the value of the calculated cell is always zero.

My workaround has been to copy a "1" and paste special - multiply on all of these columns. From that point onwards, they start behaving as numbers and the calculated cells become alive.

The workaround is tedious and I have to do it again and again. How can I do it more elegantly?
Avatar of Michal Ziemba
Michal Ziemba
Flag of Poland image

Hi
if the data type you are querying may contain not only numbers but regular characters than you need to convert the values after they are imported to Excel.
You could also try some suggestion from this thread: https://www.experts-exchange.com/questions/26573899/Convert-excel-query-data-to-numbers-rather-than-text.html
If the Access query includes calculated values, it is possible that the method used is generating text strings rather than actual numeric values.  Try fixing the query.
Avatar of Member_2_7966563
Member_2_7966563

ASKER

I tried to force the column to produce numerical outputs by using the VAL and FORMATNUMBER functions. But they were still imported into Excel as text anyway. How else could I fix the query?
SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It comes from access. Check if there the column defined as number format from .access table column.
Just so you know, if you use the NZ( ) function in a query, it will always return a string value, even if the value you provide is numeric.  You can see this by looking at the results of the query, you will see that the numbers are left aligned, instead of right.  If you wrap that in Val( ) or one of the numeric conversion functions, as Pat mentioned above, it should properly convert it to a number which will export properly to Excel.
It solved the problem