SOLVED

Excel treats numbers as text

%3CLINGO-SUB%20id%3D%22lingo-sub-2500498%22%20slang%3D%22en-US%22%3EExcel%20treats%20numbers%20as%20text%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2500498%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20downloaded%20an%20excel%20file%20from%20Visma%20(accounting%20software)%20in%20csv%20format.%3C%2FP%3E%3CP%3EExcel%20does%20not%20recognize%20the%20numbers%20as%20such%20and%20does%20not%20even%20show%20any%20error%20warning%20(normally%20you%20get%20the%20small%20green%20rectangle%20in%20the%20upper%20left%20corner%20of%20the%20cell).%3C%2FP%3E%3CP%3EThe%20following%20trials%20all%20failed%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20use%20%22paste%20special%22%20with%20add%20or%20multiply%3C%2FP%3E%3CP%3E-%20use%20%3Dvalue%20formula%26nbsp%3B%3C%2FP%3E%3CP%3E-%20use%20%22Data%22%20-%20%22Text%20to%20Columns%22%20%22Fixed%20with%22%20%22Finish%22%3C%2FP%3E%3CP%3E-%20change%20the%20format%20from%20%22general%22%20to%20number%3C%2FP%3E%3CP%3E-%20converted%20csv%20to%20xlsx%20via%20an%20online%20converter%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20attached%20the%20file.%20Is%20there%20anybody%20who%20knows%20the%20redeeming%20solution%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%2C%3C%2FP%3E%3CP%3EAnn%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2500498%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2500602%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20treats%20numbers%20as%20text%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2500602%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1001160%22%20target%3D%22_blank%22%3E%40Ann_Woo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20first%20place%2C%20the%20values%20use%20comma%20as%20decimal%20separator.%3C%2FP%3E%0A%3CP%3EIf%20you%20use%20point%20as%20decimal%20separator%2C%20press%20Ctrl%2BH%20to%20activate%20the%20Replace%20dialog.%3C%2FP%3E%0A%3CP%3EEnter%20a%20comma%20in%20the%20'Find%20what'%20box%20and%20a%20point%20in%20the%20'Replace%20with'%20box%2C%20then%20click%20'Replace%20All'.%3C%2FP%3E%0A%3CP%3EOf%20course%2C%20if%20you%20use%20comma%20as%20decimal%20separator%2C%20you%20should%20skip%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20second%20place%2C%20the%20values%20use%20a%20space%20as%20thousands%20separator.%3C%2FP%3E%0A%3CP%3EPress%20Ctrl%2BH%20to%20activate%20the%20Replace%20dialog.%3C%2FP%3E%0A%3CP%3EEnter%20a%20space%20in%20the%20'Find%20what'%20box%20and%20clear%20the%20'Replace%20with'%20box%20so%20that%20it%20is%20empty%2C%20then%20click%20'Replace%20All'.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello Community,

 

I have downloaded an excel file from Visma (accounting software) in csv format.

Excel does not recognize the numbers as such and does not even show any error warning (normally you get the small green rectangle in the upper left corner of the cell).

The following trials all failed:

 

- use "paste special" with add or multiply

- use =value formula 

- use "Data" - "Text to Columns" "Fixed with" "Finish"

- change the format from "general" to number

- converted csv to xlsx via an online converter

 

Please find attached the file. Is there anybody who knows the redeeming solution?

 

Kind regards,

Ann

2 Replies
best response confirmed by Ann_Woo (New Contributor)
Solution

@Ann_Woo 

In the first place, the values use comma as decimal separator.

If you use point as decimal separator, press Ctrl+H to activate the Replace dialog.

Enter a comma in the 'Find what' box and a point in the 'Replace with' box, then click 'Replace All'.

Of course, if you use comma as decimal separator, you should skip that.

 

In the second place, the values use a space as thousands separator.

Press Ctrl+H to activate the Replace dialog.

Enter a space in the 'Find what' box and clear the 'Replace with' box so that it is empty, then click 'Replace All'.

@Ann_Woo 

It is also possible to use PowerQuery to import the data, removing spaces and adjusting separators as required.

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ReplacedCommas = Table.ReplaceValue(Source,",",".",Replacer.ReplaceText,{"Debet","Kredit","Saldo"}),
    RemovedSpaces = Table.ReplaceValue(ReplacedCommas," ","",Replacer.ReplaceText,{"Debet", "Kredit", "Saldo"}),
    #"Changed Type" = Table.TransformColumnTypes(RemovedSpaces,{{"Debet", type number}, {"Kredit", type number}, {"Saldo", type number}})
in
    #"Changed Type"

This is best if you can import the data from source using PowerQuery.

An alternative for Excel 365 users with the authority to select insider beta is to use a Lambda function to hide the messy formulas.

= LAMBDA(a,
     LET(
      t, SUBSTITUTE(B5:B13," ",""),
      v, SUBSTITUTE(t, ",","."),
      IFERROR(--v,t) )
  )

image.png