Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
laceyMKTSP
 
Posts: n/a
Default corresponding numbers and letters

i was told there is a way to make certain letters equal numbers. EX.
BREADNMILK is 1234567890 / B=1 R=2 and so on. This is so each product has a
digit code for the price. EX. EDB = $3.51. I don't know how to do that but my
boss said it's possible. HELP!!

-stuck at work, seattle
--
thanks for your help
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

You could use a UDF such as:

Function Convert(rCode As Range) As String

Dim i As Long
Dim strLetter As String
Dim strNumber As String
Dim strPrice As String

For i = 1 To Len(rCode)
strLetter = Mid(rCode, i, 1)
Select Case strLetter
Case "B"
strNumber = "1"
Case "R"
strNumber = "2"
Case "E"
strNumber = "3"
Case "A"
strNumber = "4"
Case "D"
strNumber = "5"
Case "N"
strNumber = "6"
Case "M"
strNumber = "7"
Case "I"
strNumber = "8"
Case "L"
strNumber = "9"
Case "K"
strNumber = "0"
End Select
strPrice = strPrice & strNumber
Next i

Convert = Format(strPrice / 100, "$#,##0.00")

End Function

---

Call it with:

=Convert(A1)

HTH
Jason
Atlanta, GA


"laceyMKTSP" wrote:

i was told there is a way to make certain letters equal numbers. EX.
BREADNMILK is 1234567890 / B=1 R=2 and so on. This is so each product has a
digit code for the price. EX. EDB = $3.51. I don't know how to do that but my
boss said it's possible. HELP!!

-stuck at work, seattle
--
thanks for your help

  #3   Report Post  
laceyMKTSP
 
Posts: n/a
Default

wow, do i feel like an idiot because that didnt make sense at all....maybe
tell my what to highlight, where to put it, and what to input so it comes out
right. i thought i was pretty good at this thing but yeah, u lost me lol
--
thanks for your help


"Jason Morin" wrote:

You could use a UDF such as:

Function Convert(rCode As Range) As String

Dim i As Long
Dim strLetter As String
Dim strNumber As String
Dim strPrice As String

For i = 1 To Len(rCode)
strLetter = Mid(rCode, i, 1)
Select Case strLetter
Case "B"
strNumber = "1"
Case "R"
strNumber = "2"
Case "E"
strNumber = "3"
Case "A"
strNumber = "4"
Case "D"
strNumber = "5"
Case "N"
strNumber = "6"
Case "M"
strNumber = "7"
Case "I"
strNumber = "8"
Case "L"
strNumber = "9"
Case "K"
strNumber = "0"
End Select
strPrice = strPrice & strNumber
Next i

Convert = Format(strPrice / 100, "$#,##0.00")

End Function

---

Call it with:

=Convert(A1)

HTH
Jason
Atlanta, GA


"laceyMKTSP" wrote:

i was told there is a way to make certain letters equal numbers. EX.
BREADNMILK is 1234567890 / B=1 R=2 and so on. This is so each product has a
digit code for the price. EX. EDB = $3.51. I don't know how to do that but my
boss said it's possible. HELP!!

-stuck at work, seattle
--
thanks for your help

  #4   Report Post  
laceyMKTSP
 
Posts: n/a
Default

thank-you so, so much for that! i just got it done and its perfect....can i
ask how you learn how to do things like that? i mean, i dont want to have to
come on here and ask people to help everytime i need something. id love to
know how to do it on my own....thank-you again though!!!!
--
thanks for your help


"Jason Morin" wrote:

You could use a UDF such as:

Function Convert(rCode As Range) As String

Dim i As Long
Dim strLetter As String
Dim strNumber As String
Dim strPrice As String

For i = 1 To Len(rCode)
strLetter = Mid(rCode, i, 1)
Select Case strLetter
Case "B"
strNumber = "1"
Case "R"
strNumber = "2"
Case "E"
strNumber = "3"
Case "A"
strNumber = "4"
Case "D"
strNumber = "5"
Case "N"
strNumber = "6"
Case "M"
strNumber = "7"
Case "I"
strNumber = "8"
Case "L"
strNumber = "9"
Case "K"
strNumber = "0"
End Select
strPrice = strPrice & strNumber
Next i

Convert = Format(strPrice / 100, "$#,##0.00")

End Function

---

Call it with:

=Convert(A1)

HTH
Jason
Atlanta, GA


"laceyMKTSP" wrote:

i was told there is a way to make certain letters equal numbers. EX.
BREADNMILK is 1234567890 / B=1 R=2 and so on. This is so each product has a
digit code for the price. EX. EDB = $3.51. I don't know how to do that but my
boss said it's possible. HELP!!

-stuck at work, seattle
--
thanks for your help

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
no row numbers or column letters DISPLAYED RagDyer Excel Discussion (Misc queries) 4 April 24th 23 03:42 AM
How do I sort letters before numbers in Excel? RiverGirl Excel Discussion (Misc queries) 4 May 27th 05 04:09 PM
Columns in letters vs numbers garyflood Excel Discussion (Misc queries) 1 April 22nd 05 03:21 PM
VLOOKUP for a cell with both letters and numbers Sonohal Excel Discussion (Misc queries) 6 April 8th 05 02:13 PM
Finding Numbers with Cells that also contain letters Adam Excel Discussion (Misc queries) 7 December 29th 04 02:41 PM


All times are GMT +1. The time now is 09:49 AM.

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

About Us

"It's about Microsoft Excel"