Text.Middle not working Excel 2016

volius

New Member
Joined
Dec 5, 2017
Messages
2
Hi,

After Excel update from 2013 to 2016 version not working my oldest files with Power Query commands Text.Middle. i get the error "Text.Middle wasn't recognized"

if (Text.Length(
Code:
) = 25) then Text.Middle([Code],0,17) else Text.Middle([Code],0,10)

How fix this problem?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I don't see any problem with your IF. It works

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Result", each if (Text.Length([PLAIN][Code][/PLAIN]) = 25) then Text.Middle([PLAIN][Code][/PLAIN],0,17) else Text.Middle([PLAIN][Code][/PLAIN],0,10)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Code"})
in
    #"Removed Columns"[/SIZE]


[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Code[/td][td][/td][td=bgcolor:#70AD47]Result[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]abcdefghijklmnopr12345678[/td][td][/td][td=bgcolor:#E2EFDA]abcdefghijklmnopr[/td][/tr]

[tr=bgcolor:#FFFFFF][td]abcdefghij12345[/td][td][/td][td]abcdefghij[/td][/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,243
Messages
6,189,840
Members
453,575
Latest member
Taljanin

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