How can I force PowerQuery to load the table formatted as "Text", even if some cells contain only numbers?

Want2BExcel

Board Regular
Joined
Nov 24, 2021
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
I have this problem with some data. Some suggested it could be a PowerQuery problem.
I have a table containing serial numbers and a lot of other data. The table is created through a power query that pulls the data out of an access db.
In the Access DB the data is entered as "short text", because serial numbers often includes letters.
In the PowerQuery the data is recognized as text "ABC"
1702673786097.png
even if some cells contain only numbers, but when loading it into a table, the formatting is "Standard" which causes a problem. I tried changing the whole column to be formatted as "Text" afterwards, but it doesn't help, since this should be done prior to entering data. I tried formatting the columns to text before loading the table, but when loaded it is again "Standard". Is there a way to make the loaded table formatted as "Text" and not "Standard"?

The table has more than 5000+ rows but for 8 of these rows the data is a very long serial number, only containing numbers. For some reason Excel treats all cells that contain only numbers as numbers and not text and for these 8 cells it creates a problem because of the length. Excel is putting in a comma (9,88........) and because Excel can only store up to 15 significant digits. It converts any others after that to zeros ("0"). But those last 3 digits, if you look at the serial numbers in green, is exactly thoos 3 that makes every serial unique.
This is a problem for me in other parts of my workbook where I use a COUNTIF formula to verify that there a no duplicates in any serial numbers. But because of Excel's way of handling the data in those 8 cells I get a result of 6 duplicates, which is incorrect.
Picture1 serial numbers in question:
1702672437321.png


Picture2 the format problem:
TextFormat.png



Any ideas how to resolve this?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
COUNTIF is the problem there, not power query. Use sumproduct instead.
 
Upvote 0
COUNTIF is the problem there, not power query. Use sumproduct instead.
Can't see how SUMPRODUCT should help? I get an #VALUE error

Excel Formula:
=COUNTIF(SOURCE_DB[Serienummer],SN_LIST[Serienummer])
= 6 (because it only "reads" the 15 first numbers 988169234001149xxx. I need it to look at all the numbers so that 988169234001149491 = 1)
VS.
Excel Formula:
=SUMPRODUCT(SOURCE_DB[Serienummer],SN_LIST[Serienummer])
= #VALUE
 
Upvote 0
Use:

=SUMPRODUCT((SOURCE_DB[Serienummer]=SN_LIST[Serienummer])+0)
 
Upvote 0
I don’t know what that error is. What language is your excel in?
If you just apply the formula for one cell of the second range, what do you get?
 
Upvote 0
Solution
I don’t know what that error is. What language is your excel in?
If you just apply the formula for one cell of the second range, what do you get?
It a danish version. I think the #I/T error in this version correlates to #N/A in english version (Excel ERROR: #I/T (#N/A)

If I just apply the formula for one cell of the second range, I get the result I'm looking for =1

...so it seems like it can't process the whole column SN_LIST[Serienummer] in the other table :unsure: That seems weird...
 
Upvote 0
I don’t know what that error is. What language is your excel in?
If you just apply the formula for one cell of the second range, what do you get?
It wasn't quite the solution I expected, but nevertheless it works.

Thx for the attention, your time and solution RoryA 👌
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top