+ Reply to Thread
Results 1 to 5 of 5

Formula not working

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Formula not working

    I am doing some data analysis and -I am quite new to excel and a formula I am trying to input does not seem to work. I have marks /grades ---- ie 3-,3,3+ 4-,4,4+ etc and I am trying to use a formula to assign numerical values so that I can get the top student in the group. =LOOKUP(B6,{"3-","3","4","4+"},{"1","2","3","4"}) I tried this but it does not work-its fine for the 3- and 4+ but not for 3,4

    Thanks for your help.

  2. #2
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Formula not working

    Welcome to the forum Santasanta. Could you please upload a workbook with sample data? Would be helpful to see the way your data is organized.

    Thanks.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,286

    Re: Formula not working

    The problem is that you have text values in both sides of the lookup, that is, everything in quotes is text. Now "4+" is text, whether or not it is in quotes, and is not equal a numeric value of 4 ... which, in this instance, is not what you want. Similarly, "3-" is text, with or without quotes. 3 and -3 are numbers.

    So, if you put 3-, 3+, 4-, 4+, etc in cell B6, they will be treated as text and find a match. However, if you type 3 or 4, it will be seen as a number and not match "3" or "4". If you put a single quote in front of the 3 or 4 the value will be treated as text and find a match.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula not working

    Thanks TMShucks It now works

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,286

    Re: Formula not working

    You're welcome. Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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