Forum Discussion

lipster26's avatar
lipster26
Frequent Visitor
4 years ago
Solved

Parse year from text

Hello,   Looking for the best way to parse the year from cells with text. The years at the beginning of the text could be done with splitting into columns, but how about the cells where the year is...
  • rohit_singh's avatar
    4 years ago

    Hi lipster26 

    Crude but effective one-liner

    = Table.AddColumn(#"Changed Type", "Year", each Number.From(Text.Range([Text],Text.PositionOf([Text], "20",Occurrence.First),4)))

     

    Kind regards,

    Rohit


    Please mark this answer as the solution if it resolves your issue.
    Appreciate your kudos! ğŸ˜Š