+ Reply to Thread
Results 1 to 9 of 9

Converting words (spelled out numbers) into actual numbers

  1. #1
    Registered User
    Join Date
    06-25-2015
    Location
    Virginia
    MS-Off Ver
    2010
    Posts
    5

    Converting words (spelled out numbers) into actual numbers

    I have a Google form that is being used by coworkers to enter data into. One of them decided to spell out some of the numbers instead of entering the numerals. I have found plenty of posts that contain the VBA for doing the reverse of this but nothing on going from the words to actual numbers. I know I could use a =VLOOKUP() table but that would be a large table.

    Could anyone point me toward some VBA code that will accomplish what I am looking for? I am using Excel 2013.

    Here is an example of what I am looking for:

    Entered into form: seven
    End result desired: 7

    Thanks!

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Converting words (spelled out numbers) into actual numbers

    Check out JL0001 at link below. Please note I am not the author of the code and am in no way trying to take credit for it.

    http://www.contextures.com/excelfileslatham.html
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Converting words (spelled out numbers) into actual numbers

    Hello Me_in_va,

    I don't think what you are looking for is possible. Please consider the example below;

    Three Million Eighty Hundred Thousand and Forty Four Dollars: First the system will have to create a number of Three Million, 3,000,000, and now it becomes stuck with the commas which could be interpreted as text. Now how would the system know where to enter the Eighty Hundred Thousand - 800,000- again with the damn comma, and then to top it all, the; "and" Forty Four Dollars, since the "and" which could appear anywhere in a large number, whilst being read as "Text", will throw another spanner in the "works".?

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Converting words (spelled out numbers) into actual numbers

    @ walruseggman,

    Nice link indeed!

    It is worthy though to note the absence of the normally used "and" with large numbers, hence the motivation to my reply.

    Regards.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Converting words (spelled out numbers) into actual numbers

    Perhaps remove every comma and every " and " - spaces necessary to ensure we ignore "and" in "thousand"
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Converting words (spelled out numbers) into actual numbers

    @kev,

    Good idea, which would require a separate Macro for "Cleaning" up, but it could lead to confusion reading the total correctly

    Regards.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Converting words (spelled out numbers) into actual numbers

    Also need to get rid of hyphens
    Require single space between every word and then testing groups of of words
    If we go as big as (US) billion (UK billion was a million million when I went to school - but our billion was deflated and now matches the inferior US billion ),
    Would need to remove these strings in reverse order:
    "zero" or "nil" or "nothing" or "zilch" to "nine"
    "ten" to "ninety nine"
    "one hundred" to "nine hundred"
    "one thousand" to "nine hundred ninety nine thousand"
    "one million" to "nine hundred ninety nine thousand million"

    replacing them via a lookup with numbers

    finally adding the whole thing up

    I think we should just ask the employee to input own data again - and supervise data entry this time!

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Converting words (spelled out numbers) into actual numbers

    Just a thought - is the employee good at spelling?
    Ignoring typos, some good pairings:
    forty/fourty
    eight/ate
    two/too
    for/four
    etc

  9. #9
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Converting words (spelled out numbers) into actual numbers

    Interesting thread, but could be easier for all concerned (especially you) if you force numeric values:

    Please Login or Register  to view this content.
    Or, if you want to force Integers
    Please Login or Register  to view this content.

+ 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. Converting Numbers into Words (i.e 1 = One)
    By sandubandu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2016, 01:29 AM
  2. Converting words to numbers
    By ExcelNewbie86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2015, 07:52 AM
  3. converting numbers to words
    By Jenman77 in forum Excel General
    Replies: 2
    Last Post: 12-14-2012, 05:17 PM
  4. converting numbers to words
    By DustySpur in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-11-2011, 06:30 PM
  5. [SOLVED] Converting numbers into words?
    By Dean in forum Excel General
    Replies: 1
    Last Post: 12-22-2005, 06:40 PM
  6. Converting numbers to words
    By tanksalevikrant in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-10-2005, 08:56 AM
  7. [SOLVED] Converting words to numbers
    By Bill Gowan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2005, 07:06 PM

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