+ Reply to Thread
Results 1 to 22 of 22

Excel formula to convert sentence in number

  1. #1
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Question Excel formula to convert sentence in number

    Hai,

    I have came across to some interesting question by a management. The question is can we add letter as numbers. Meaning each letter assigned a number and it should add or sum the numbers.

    I have letter A-Z in column A and number assigned to each letter in Column B.

    So if user type any word or words then it should sum the numbers and give me the total.

    For Example:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Appreciate if some1 can help me to get formula or VBA function as my data is huge with 700K - 900K rows

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel formula to convert sentence in number

    A small UDF does the trick:
    Please Login or Register  to view this content.
    Use as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Thanks Olly for your response.

    I forget to mentioned that numeric values are not fix to as same as mentioned above. Above mentioned number is the example only.

    A value can be 100 or the user input in the column B

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel formula to convert sentence in number

    Quote Originally Posted by Abdur_rahman View Post
    I forget to mentioned that numeric values are not fix to as same as mentioned above. Above mentioned number is the example only.

    A value can be 100 or the user input in the column B
    Sorry, I don't understand this at all.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,762

    Re: Excel formula to convert sentence in number

    I think he means that in his example, each letter is associated with its position in the English alphabet, 1-26. But in the real data, there is a translation table so that each letter in column A corresponds to a number given in column B. So you cannot use function Asc to translate the letter to a number, it has to be a lookup in columns A:B.

    (I don't know what the bit about 100 means.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  6. #6
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Let me explain.

    I have letter in column A and numbers in column B.

    The function or formula look for that letter in Column A and see what is the number next to it in Column B.

    It need to check entire string in Column C which is a big list and sum the total.

    I hope I have explained correctly to make you understand. If not please give me some time to prepare some samples and attached a worksheet.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Excel formula to convert sentence in number

    Ah, I see.

    Go on, pop up a sample workbook, to make sure I'm not making any rash assumptions!

  8. #8
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Thanks 6StringJazzer for converting my hard words into simple explanation.

    This is what I am trying to say.

    How ever I am attaching a sample for your reference.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Excel formula to convert sentence in number

    this should work for you:

    Please Login or Register  to view this content.
    Last edited by dmcgov; 06-26-2019 at 11:51 AM.

  10. #10
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Thanks dmcgov for your script but it is not working also I have huge range of sentences not only 2 cell. The above is the example how is the input.

  11. #11
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Excel formula to convert sentence in number

    what line does it fail on (choose debug) and what is the error. it is working fine on my side

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Excel formula to convert sentence in number

    Another option
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Thanks Fluff13. It is working for me if the letter are English. What about I it is not English.

    Meaning any other language. It will not work.

    What I am trying to tell you is any string in column A (Any Language) should work because it is assuming as a string not a language right.

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Excel formula to convert sentence in number

    As long as you have the letters/symbols in col A then it should work.

  15. #15
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Excel formula to convert sentence in number

    The trick to getting questions answered on a forum is to ask the question you want answered, and to provide an example that illustrates.
    Entia non sunt multiplicanda sine necessitate

  16. #16
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    I mean to say if I put letters Arabic or hindi or Urdu it should work right but it is not working.

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Excel formula to convert sentence in number

    In that case, please supply a sample workbook with representative data.

  18. #18
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Dear Fluff13.

    Please find the attachment for 2 more languages (Arabic & Urdu) sample workbook s requested.

  19. #19
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Excel formula to convert sentence in number

    Ok, try this
    Please Login or Register  to view this content.
    But the value in A3 has an extra space which you need to remove

  20. #20
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Exclamation

    Hi !

    Quote Originally Posted by Abdur_rahman View Post
    Please find the attachment for 2 more languages (Arabic & Urdu)
    As I already have a working code for English & Urdu, I guess, no in fact I'm sure your Arabic sample value is wrong !

    So check and revert as I won't post any code until we agree on a correct Arabic result …

    Edit : the issue comes from A12 cell is equal to cell A15 ‼
    Last edited by Marc L; 06-26-2019 at 11:12 PM.

  21. #21
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel formula to convert sentence in number

    Hai Fluff13,

    Thanks for your valuable help it is working for me. I really appreciate your effort on this request. Thanks once again.

  22. #22
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Excel formula to convert sentence in number

    You're welcome & thanks for the feedback

+ 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. [SOLVED] cut number from some sentence
    By kimudao in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2019, 08:39 AM
  2. Cross reference letter case: Beginning of sentence and middle of sentence
    By caswell1000 in forum Word Formatting & General
    Replies: 4
    Last Post: 02-07-2019, 05:25 PM
  3. [SOLVED] Extract a number from a sentence to use in formula?
    By ocannon1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2017, 07:40 AM
  4. Convert specific number into specific sentence
    By sarangapani in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-26-2013, 03:57 PM
  5. [SOLVED] CONVERT SENTENCE TO COLUMN
    By JonnieP in forum Excel General
    Replies: 1
    Last Post: 08-07-2006, 05:45 AM
  6. Excel should have a formula to convert number into words
    By Nitish Rawat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2005, 03:00 PM
  7. Replies: 10
    Last Post: 10-07-2005, 03:05 PM

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