value of text in a cell in numbers

ShyamSharma

New Member
Joined
Dec 14, 2017
Messages
20
Hi,

I am working on a project wherein we have assigned value to all 26 characters of alphabets e.g a=1, b=1.

Requirement:- As i write some word (not letter) in the cell , it should give the value of word in any other cell.
Since i am not a VBA user, request you to suggest some function based solution.

Hope to hear soon from you on the same.

With Warm Regards

Shyam Sharma
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Welcome to the board!

Try this:

ABCDEF
1LetterValue
2a1
3b2cab6
4c3house68
5d4zero64
6e5
7f6
8g7
9h8
10i9
11j10
12k11
13l12
14m13
15n14
16o15
17p16
18q17
19r18
20s19
21t20
22u21
23v22
24w23
25x24
26y25
27z26

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
F3{=SUM(SUMIF($A$2:$A$27,MID(E3,ROW(INDIRECT("1:"&LEN(E3))),1),$B$2:$B$27))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Welcome to the board!

Try this:

ABCDEF
1LetterValue
2a1
3b2cab6
4c3house68
5d4zero64
6e5
7f6
8g7
9h8
10i9
11j10
12k11
13l12
14m13
15n14
16o15
17p16
18q17
19r18
20s19
21t20
22u21
23v22
24w23
25x24
26y25
27z26

<tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
F3{=SUM(SUMIF($A$2:$A$27,MID(E3,ROW(INDIRECT("1:"&LEN(E3))),1),$B$2:$B$27))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>


Beautifully done!! Highly appreciated prompt reply!!
 
Upvote 0
Beautifully done Eric!!

I was wondering what if i don't want to put numbers in other cells...

Can there be any method like if function we feed all the values in function only.

With Warm Regards

Shyam Sharma
 
Upvote 0
=IF(A1="","",SUMPRODUCT(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64))


Excel 2010
AB
1cab6
2house68
3zero64
4 
Sheet1
Cell Formulas
RangeFormula
B1=IF(A1="","",SUMPRODUCT(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64))
B2=IF(A2="","",SUMPRODUCT(CODE(MID(UPPER(A2),ROW(INDIRECT("1:"&LEN(A2))),1))-64))
B3=IF(A3="","",SUMPRODUCT(CODE(MID(UPPER(A3),ROW(INDIRECT("1:"&LEN(A3))),1))-64))
B4=IF(A4="","",SUMPRODUCT(CODE(MID(UPPER(A4),ROW(INDIRECT("1:"&LEN(A4))),1))-64))
 
Upvote 0
Scott's formula is the way to go if you use the values 1-26 in order. If you want to change the values, then we can tweak the formula to:

=IF(A1="","",SUM(CHOOSE(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26)))
with Control+Shift+Enter.

Both formulas will return incorrect results though if you have non-alphabetic characters in your word, even spaces.
 
Upvote 0
Many Thanks Eric and Scott!!

Each solution is better than other......

Now the other problem which has occurred is SPACE if i give space between two words Like Shyam Sharma it gives wrong value since the value of Code(" ")=32.

Would be a great help in case i can have solution for both the options

1)
=IF(A1="","",SUMPRODUCT(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64))

<tbody>
</tbody>
2)
=IF(A1="","",SUMPRODUCT(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64))

<tbody>
</tbody>
=IF(A1="","",SUM(CHOOSE(CODE(MID(UPPER(A1),ROW(INDIRECT("1:"&LEN(A1))),1))-64,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26)))
with Control+Shift+Enter.

Hope to hear soon from you on the above.

With Warm Regards

Shyam Sharma
 
Upvote 0
Hi, here are a couple of options..:


Excel 2013/2016
ABC
1Text1)2)
2Shyam Sharma126126
3house6868
4cab66
5zero6464
6# * cab house zero 123138138
Sheet1
Cell Formulas
RangeFormula
C2=SUMPRODUCT(LEN(A2)-LEN(SUBSTITUTE(UPPER(A2),CHAR(COLUMN(INDIRECT("BM:CL"))),"")),{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26})
B2{=SUM(IFERROR(SEARCH("~"&MID(A2,ROW(INDIRECT("1:" & LEN(A2))),1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top