+ Reply to Thread
Results 1 to 5 of 5

Assigning a numerical value to a letter in excel

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Assigning a numerical value to a letter in excel

    Hello

    I am trying to assign a numerical value to letters used in an excel spreadsheet.

    L=7.5 / E = 7.5 / SL= 6.25 / SE = 6.25 / N = 9

    It is for a shift pattern spreadsheet so names are down the left hand side (Column a) then mon - sun in row 1 and then depending on the shift worked the letter shown in the spreadsheet - then i need to show a column with total hours worked - depending on the shift letters. So if someone has worked 3 L shifts and 4 N shifts total hours worked would show as 58.5

    My excel knowledge is pretty basic and i have been looking and believe this could be done using a lookup table but i cant work out what formula to put in the total hours column to get it show

    Any help would be very much apprecaiated

    Thanks

    Lisa


    IMAGE.jpg

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Assigning a numerical value to a letter in excel

    hi Lisa, welcome to the forum. assuming data in B4:H4, try:
    =SUMPRODUCT(--(LOOKUP(B4:H4,{"E";"L";"N";"SE";"SL"},{7.5;7.5;9;6.25;6.25})))

    do note that my alphabets are arranged in ascending order or it won't work. you could also put the alphabets in column K & values in column L, then:
    =SUMPRODUCT(--(LOOKUP(B4:H4,K4:K8,L4:L8)))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Assigning a numerical value to a letter in excel

    Yes, create this 2 column table:

    L.....7.5
    E.....7.5
    SL...6.25
    SE...6.25
    N.....9

    Assume that table is in the range A10:B14.

    B2:H2 = shift codes worked

    Then, the formula would be:

    =SUMPRODUCT(SUMIF(A10:A14,B2:H2,B10:B14))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Assigning a numerical value to a letter in excel

    There's no need for the double unary minus in those formulas.

  5. #5
    Registered User
    Join Date
    04-15-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Assigning a numerical value to a letter in excel

    Thank you so much that worked a treat :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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