+ Reply to Thread
Results 1 to 3 of 3

How to make a cell value generate a cell value in another cell

Hybrid View

  1. #1
    rantz
    Guest

    How to make a cell value generate a cell value in another cell

    Hello,

    I need to make a cell value generate a cell value in another cell.

    Example.

    If cell A1 contains "Apple" I want B1 to have the value
    "fruit". If I write beatles in A1 I want B1 to spell out
    "music"


    I have a list of two columns
    Apple fruit
    Strawberry berries
    Saw hardware
    Beatles music
    ..
    ..

    My original solution to this problem was to use the if-function in B2
    like this

    =IF(A1="Apple", "fruit", IF(A1="Strawberry", "berries"
    IF(A1="Saw", "hardware",....))))

    This may not be very elegant but it worked until I had a list that was
    longer then 7. Apparently Excel can't handle more then 7
    if-functions.

    There should be an easier way to accomplish this. I could probably
    write the If-functions directly into the macro that I'm building but
    I would appreciate a easier solution. Perhaps something containing the
    VLOOKUP-function?


  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    VLOOKUP, as you say, is probably best

    If your table is C1:D10 then use this formula in B1

    =VLOOKUP(A1,$C$1:$D$10,2,0)

  3. #3
    rantz
    Guest

    Re: How to make a cell value generate a cell value in another cell

    You saved me a ton of work, thanks a LOT!!!!


+ 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