+ Reply to Thread
Results 1 to 7 of 7

Giving letters a number value

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Giving letters a number value

    I would like to change my work schedule so that I use a legend/key instead of entering numbers for the hours.

    For example instead of entering 8 hours for an employee I would like to use the letter 'A' to signify not only the 8 hours but the 'A' is also representative of the building the employee should be at. The bldg info is not included within the employee schedule, it's really just a reference. I've created a table where different letters are equal to a certain number (ie A=8hrs, B=8hrs,...g=12hrs-different bldg's require different hours). Using vlookup I've tried to create a total at the end of each row that will calculate what each value stands for and add it together at the end in a total column. Here is the formula I have but when I use it is not giving me the result I need. Is this even possible, to have a legend whose values correspond to a number and then to create a total column based on the values from the legend? Any help would be greatly appreciated


    =VLOOKUP("a,b,c,d,e,f,g,h",G43:H50,2)

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Giving letters a number value

    =SUMPRODUCT(COUNTIF($G$43:$H$50,{"a","b","c","d","e","f","g","h"})*{1,2,3,4,5,6,7,8})

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,334

    Re: Giving letters a number value

    Hi tlyke212 and welcome to the forum,

    I'm afraid you have great intentions with your formula but it doesn't work. See if the attached that does one vlookup per cell works for you.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Giving letters a number value

    I thought since I would like each letter to represent a specific value of either 8, 8.5 or 12 that vlookup should work. Can you tell me why it didn't work?

  5. #5
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Giving letters a number value

    VLOOKUP takes only one value and is looking for data not to summarize them.
    Test my formula and see if it works

  6. #6
    Registered User
    Join Date
    07-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Giving letters a number value

    That worked perfectly. Thank you so much. I was getting so frustrated with the vlookup.

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Giving letters a number value

    Quote Originally Posted by Tlyke212 View Post
    That worked perfectly. Thank you so much. I was getting so frustrated with the vlookup.
    You are welcome.
    If you have not that this alredy can you click the star under my name,please?

+ 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