+ Reply to Thread
Results 1 to 47 of 47

Convert alphabets to numeric values

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Convert alphabets to numeric values

    Hi!

    Is it possible to convert :

    Nine Hundred Sixty Three Thousand Seven Hundred Eighty One
    Eight Hundred Seventy Eight Thousand Eight Hundred Seventy Eight
    Eight Hundred Twenty Two Thousand Seven Hundred Eighty Four
    Eight Hundred Twenty Six Thousand One Hundred Eighty Nine
    Nine Hundred Three Thousand Nine Hundred Six

    to numeric...

    EG:
    963781
    878878
    872784
    903906

    Appreciate your early reply

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    This got the last one

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Obviously, it needs more work - but, thanks for the rep!

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    In Progress
    Last edited by xladept; 07-06-2014 at 12:03 AM.

  5. #5
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Thank you! for your effort and time

    i shall wait

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Hi KJX,

    Thanks for the rep!

    This works for your sample and some others - we'll probably find other up to six digit numbers for which it needs to be tweaked:

    Please Login or Register  to view this content.
    Last edited by xladept; 07-06-2014 at 03:35 PM.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    This Function is a small improvement:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Hi!

    Thanks for all your support

    While i try to convert Alphabets to numeric
    Am receiving some errors ....... only when it ends with (Twenty; Thirty; Forty; Fifty.....)


    Please refer to the attachment for more details






    Quote Originally Posted by xladept View Post
    This Function is a small improvement:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    A few corrections:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Excellent work!

    Thanks a lot!!!!!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    You're welcome - there will probably be more tweaks

  12. #12
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Hi!

    A small error occurs when it ends with "Hundred"

    Eg: Nine Hundred -> 9

    Please check the attachment...

    Thank you in advance






    Quote Originally Posted by xladept View Post
    A few corrections:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    I anticipate more tweaks but:

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Thank you! Am trying to make it error free!

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Have fun and let me know of the next necessary tweak!

  16. #16
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Hi!

    Thank you for you time!




    1.
    A prior problem got repeated Post #8
    i.e.: False result when any string ends with : Twenty; Thirty;........ Ninety.


    2. Error: wherever a "Hundred" is followed by a "Seven" or "Twelve"
    Eg: One Hundred Seven
    Once Thousand Two Hundred Twelve, etc


    Other than these two........ i think everything is perfect! Till now









    Quote Originally Posted by xladept View Post
    I anticipate more tweaks but:

    Please Login or Register  to view this content.
    Last edited by kjxavier; 09-14-2014 at 08:27 AM. Reason: spelling error

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Another Tweak

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Thank you! No tweaks left ........

    There will be more who need this Function!

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Oh - I'm sure there will be more tweaks - but thanks! And thanks for the rep!

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Another Tweak/sktneer:

    Please Login or Register  to view this content.

  21. #21
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Convert alphabets to numeric values

    Yes it works now perfectly. What is the largest number which can be converted from words to numeric with this code?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    @sktneer - I don't know, I just worked on the examples given and developed no theory

  23. #23
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Convert alphabets to numeric values

    If you have time you can extend this code to take care of any number entered no matter how large it is. Then this code will be a unique code to convert number in words to digits. But I think that will really consume lots of time as well to considering all the possible numbers in question.

    This code certainly fulfills the OP's requirement and he must be really pleased with you for this nice code.

  24. #24
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    @ sktneer - Thanks! I'll go at it from time to time as different challenges arise.

  25. #25
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Hi! I tried from 1 - 999999, and that has fulfilled my requirement!

    U got it sktneer! ...... am really pleased for such a nice code!
    Even you have helped me with a great code before!
    You guys are really great & helpful too!

    Am really thankfull
    Last edited by kjxavier; 09-16-2014 at 01:12 PM.

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    You're welcome and thanks for the rep!

  27. #27
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Convert alphabets to numeric values

    Thanks kjxavier for the feedback. In this thread all the credit goes to xladept who has provided you a very nice code.

  28. #28
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Convert alphabets to numeric values

    Moreover if that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

  29. #29
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Convert alphabets to numeric values

    Playing with this (nice job) and getting 900 for Nine Hundred one to Nine Hundred nine, and 9 for Nine Hundred ten.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  30. #30
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    @ChemistB - I tried those numbers and they worked for me (are you hitting F9 to make it calculate?)!


    Oh! Nevermind they have to be in proper case at this time.

  31. #31
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Error detected!

    Sorry,
    It was my fault that i did not recognize the error!


    1. Wherever it ends with "Twenty;Thirty;.......Ninety " (repeated)
    2. Whenever a number is followed by a "Seven"

    Thank you





    Quote Originally Posted by xladept View Post
    Another Tweak/sktneer:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kjxavier; 09-17-2014 at 01:43 PM.

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    This next installment also handles the ChemistB proper case issue

    Please Login or Register  to view this content.

  33. #33
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Hi!

    Error detected!

    1. Single digit "Seven " -> #VALUE!
    2. Whenever : Twenty; Thirty;...... Ninety is followed by a "Seven" -> negative result

    Thanks for sparing you valuable time!







    Quote Originally Posted by xladept View Post
    This next installment also handles the ChemistB proper case issue

    Please Login or Register  to view this content.
    Last edited by kjxavier; 09-18-2014 at 09:57 AM. Reason: correction

  34. #34
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Convert alphabets to numeric values

    Quote Originally Posted by kjxavier View Post
    Error detected!

    Sorry,
    It was my fault that i did not recognize the error!


    1. Wherever it ends with "Twenty;Thirty;.......Ninety " (repeated)
    2. Whenever a number is followed by a "Seven"

    Thank you

    kjxavier,

    For each of the numbers reported, you have a blank space after the last word. Remove it and you will have the correct result.


    Number with million is not correct:

    Seven Hundred Thirty Seven Thousand One Hundred Eighty One 7307181
    Eight Hundred Twenty Seven Thousand Five Hundred Ninety Eight 8207598
    Last edited by Indi_Ra; 09-18-2014 at 03:22 AM.

  35. #35
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    @ Indi_Ra

    Thanks for helping me rectifying some errors


    Prob is not just with Million ....

    Probs:

    1. Single digit "Seven " -> #VALUE!
    2. Twenty Seven Thousand -> 207000; Thirty Seven Thousand........ Ninety Seven Thousand


    Thanks Indira
    Last edited by kjxavier; 09-18-2014 at 09:58 AM.

  36. #36
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Another Tweak......

  37. #37
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    2. Error result where it ends with : Twenty; Thirty;...... Ninety -> 2;3;.....9
    3. Whenever : Twenty; Thirty;...... Ninety is followed by a "Seven" -> negative result
    These are both working for me - I fixed the Seven alone issue

    Please Login or Register  to view this content.

  38. #38
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Hi!

    Sorry for sparing your valuable time!
    'Seven alone issue was my fault'

    but some others!.........

    Please refer to the attached sheet.......
    certain errors occurred in my sheet......... please correct me!

    your early response will be highly appreciated!
    If possible attach me a corrected version of the same sheet.

    Thanking you in advance!


    Quote Originally Posted by xladept View Post
    These are both working for me - I fixed the Seven alone issue

    Please Login or Register  to view this content.
    Attached Files Attached Files

  39. #39
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Well KJ we meet again convert-alphabets-to-numeric-values.xlsm

    Please Login or Register  to view this content.

  40. #40
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    The perfect coding!

    Great work xladept!
    You have helped me a lot!

    Thank you once again!

  41. #41
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    I hope so - thanks for the rep!

  42. #42
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Re: Convert alphabets to numeric values

    Hi! xladept

    Many thanks for all you early codes!

    Can you make an extension to the prior code!

    I tried it till:ONE HUNDRED MILLION...... n it was really good! but with 2 tweaks!

    When it encounters a : Twenty Seven Million; Thirty Seven Million; ..... and One Hundred Million


    Please go through the attached Excel sheet!

    Thank you again for that excellent code!

    Appreciate your early reply!





    Quote Originally Posted by xladept View Post
    Well KJ we meet again Attachment 346332

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kjxavier; 10-27-2014 at 04:06 AM. Reason: attach file

  43. #43
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Hello Again KJ,

    Try this:

    Please Login or Register  to view this content.

  44. #44
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Convert alphabets to numeric values

    Hi,

    This is no good:

    One Hundred Million Two Hundred Fifty Thousand Six Hundred Fifty Two ________1.250.652
    One Hundred Seven Million Two Hundred Fifty Thousand Six Hundred Fifty Two ___17.250.652

  45. #45
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Next

    Please Login or Register  to view this content.

  46. #46
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Convert alphabets to numeric values

    Perfect

    Great code! Xladept!

    Thank you very much! you are really great and helpful!

  47. #47
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Convert alphabets to numeric values

    Hi KJ,

    You're welcome and thanks for the rep! 'Til the next time

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert Text Values to Specific Numeric Values
    By lmp101010 in forum Excel General
    Replies: 5
    Last Post: 09-06-2014, 04:00 PM
  2. [SOLVED] VBA Code for Textbox: First 3 characters Alphabets next 3 characters numeric
    By honger in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2013, 01:05 AM
  3. [SOLVED] How to convert numeric data in an excel column into a string of comma values.
    By desgordon in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-04-2012, 12:10 PM
  4. How to convert numeric values from English to French?
    By quikgun15 in forum Excel General
    Replies: 3
    Last Post: 07-14-2010, 03:44 PM
  5. Replies: 4
    Last Post: 02-06-2006, 03:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1