Forum Discussion
Mr_Triongl
3 years agoFrequent Visitor
How to validate phone numbers
Hi, I have a list of phone numbers in my data and want to validate that the numbers are in the correct format - Starting with 01/+44 and 11 digits in total. Anything with less digits or greater t...
- 3 years ago
hi Mr_Triongl ,
create a new step ( press fx)
paste the following in the formula bar:
= Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([Phone Number],"01",Comparer.OrdinalIgnoreCase) or Text.StartsWith([Phone Number],"+44",Comparer.OrdinalIgnoreCase) and Text.Length([Phone Number])= 11 then "Valid" else "Invalid")Appreciate a thubs up if this is helpful.
Please accept as the solution if it resolves the question.
adudani
3 years agoMemorable Member
Please replace #"Changed Type" to the name of your previous step.
The error will get resolved.
Mr_Triongl
3 years agoFrequent Visitor
Thanks for that adudani that formula worked a treat.