itsnotaboutthecell

Power Query M - ASCII Converter

Sep 13th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. /*
  2. Created By: Alex Powers
  3. Website: http://www.itsnotaboutthecell.com
  4. LinkedIn: https://www.linkedin.com/in/alexmpowers/
  5. Challenge: https://www.excelguru.ca/blog/2018/09/11/power-query-challenge-3/
  6.  
  7. */
  8.  
  9. (Word as text) =>
  10. let
  11. getChar = (count as number) =>
  12. let
  13. char = try Character.ToNumber(Text.Lower(Text.Range(Word, count, 1))) - 96 otherwise null
  14. in
  15. if char is null then {}
  16. else List.Combine({{char}, @getChar (count + 1)}),
  17.  
  18. Final = List.Sum(getChar(0))
  19. in
  20. Final
Advertisement
Add Comment
Please, Sign In to add comment