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?
Member_2_7966563Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michal ZiembaIT AdministratorCommented:
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
PatHartmanCommented:
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.
Member_2_7966563Author Commented:
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?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

PatHartmanCommented:
Val() should produce a number.  I've never seen FormatNumber() so I have no idea how it works.

I would have used cLng(), cInt(), cDbl(), cCurr() or whatever specific data type I needed.

Please post your query.
Member_2_7966563Author Commented:
Thanks for the question. It led me to examine my query, and one small change fixed everything.

Instead of Val(x) I just used 1*x, and that forced the output to be a number

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bharat BhushanSolution ManagerCommented:
It comes from access. Check if there the column defined as number format from .access table column.
Dale FyeOwner, Developing Solutions LLCCommented:
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.
Member_2_7966563Author Commented:
It solved the problem
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.