Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ASA
 
Posts: n/a
Default Calculating a sum of various lenght

I want to be able to place a word and assign a value to it according to the
position of its letters in the alphabet.

ie ONE = 15 for O + 14 for N + 5 for E = 34
TWO = 58

I have developed the formula
SUM(FIND(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14, 15,16},1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))-(16-LEN(A1))

is there some way to modify it so it says sum(find(mid(a1,{1..len(a1)},1)

Alan
  #2   Report Post  
JMB
 
Posts: n/a
Default

Alternatively, you could use a user-defined function. Paste the code into a
VBA module.

Function WordSum(x As String)
On Error Resume Next
x = UCase(x)
WordSum = Asc(Right(x, 1)) - 64 + _
WordSum(Left(x, Len(x) - 1))
End Function


To use enter =WordSum(A1) where A1 contains the word you want to evaluate.


"ASA" wrote:

I want to be able to place a word and assign a value to it according to the
position of its letters in the alphabet.

ie ONE = 15 for O + 14 for N + 5 for E = 34
TWO = 58

I have developed the formula
SUM(FIND(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14, 15,16},1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))-(16-LEN(A1))

is there some way to modify it so it says sum(find(mid(a1,{1..len(a1)},1)

Alan

  #3   Report Post  
JMB
 
Posts: n/a
Default

If it's possible you will have spaces in your text you can replace

x = UCase(x)

with

x = UCase(Replace(x, " ", "", 1, -1, vbTextCompare))


"ASA" wrote:

I want to be able to place a word and assign a value to it according to the
position of its letters in the alphabet.

ie ONE = 15 for O + 14 for N + 5 for E = 34
TWO = 58

I have developed the formula
SUM(FIND(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14, 15,16},1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))-(16-LEN(A1))

is there some way to modify it so it says sum(find(mid(a1,{1..len(a1)},1)

Alan

  #4   Report Post  
Krishnakumar
 
Posts: n/a
Default


Hi Alan,

Try,

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

HTH


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile: http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=386676

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating recurring date in following month, calculating # days in that period Walterius Excel Worksheet Functions 6 June 4th 05 11:21 PM
not calculating formulas doros Excel Discussion (Misc queries) 4 April 5th 05 12:29 PM
calculating SUM with two conditions Alex Excel Worksheet Functions 1 March 24th 05 08:31 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
AGE CALCULATING EXCEL SPREADSHEETS AND OTHERS! RICHARD Excel Discussion (Misc queries) 0 March 1st 05 01:53 PM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"