+ Reply to Thread
Results 1 to 4 of 4

Find "X" in range of cells and return various values based on the column "X" is found in.

  1. #1
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Find "X" in range of cells and return various values based on the column "X" is found in.

    Hello "Smarter People Than I" ...

    After 2 hours of searching for an answer to this, I give up. Can you please help with this question? (I thought it would be fairly simple to find but I was wrong!)

    I have five (5) cells in a row. Only one (1) will have an "X" in it. Based on which cell (column) it is found in, I need to return a value from a list of values.

    For example, if the "X" is in cell A2, return "Blue"; if it's in B2 return "Green"; if it's in C2 return "Brown"; if it's in D2 return "Black"; if it's in E2 return "Orange."

    I thought of nested IF statements but that seems much more complicated then necessary?

    Any help or direction will be greatly appreciated.

    Thank you!!!

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

    Re: Find "X" in range of cells and return various values based on the column "X" is found

    hi NeilAZ, welcome to the forum. do you have those texts somewhere? i'm assuming they are in A1:E5, then:
    =INDEX($A$1:$E$1,MATCH("X",A2:E2,0))

    if you don't have the texts anywhere, then:
    =LOOKUP("X",A2:E2,{"Blue","Green","Brown","Black","Orange"})
    Last edited by benishiryo; 04-14-2013 at 11:42 PM.

    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
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Find "X" in range of cells and return various values based on the column "X" is found

    Please Login or Register  to view this content.
    Hope this help!
    -If the problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved".

    -Always upload a workbook before start your question
    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    +++ If my answer(s) helped you, please add me reputation by click on * +++

  4. #4
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Find "X" in range of cells and return various values based on the column "X" is found

    Hello benishiryo! Wow! That is slick! I looked and looked for a solution like this but couldn't find anything. You are awesome. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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