LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rantz
 
Posts: n/a
Default 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?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate random numberes using reference to the other cell. ramana Excel Worksheet Functions 7 October 31st 05 07:09 AM
How to take a cell that has 3 values and make 2 more new lines Phil Excel Worksheet Functions 4 October 23rd 05 10:53 PM
How do I make a picture stay inside a cell? Davdi Keltner Excel Discussion (Misc queries) 2 October 7th 05 08:19 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 01:01 PM


All times are GMT +1. The time now is 04:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"