Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default coding with several arguments

Hi all. I have a lot of data in columns in text format that I want to
code in to whole numbers.

eg. a lot of rows in say column A than contain either "red", "blue",
"black" etc.

I need a formula (ideally able to placed on a different sheet!) for
corresponding rows in a new column eg: C, that would say: if A1 "red"
then C1=0, if A1="blue" then C1=2, if A1="black" then C1=3 and so
forth with up to 20 arguments!.

Is this at all possiable.

Thanks. Vince

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default coding with several arguments

Vinnie,
Yes it is and it uses vlookup.

Make a table on a sheet with the code table
[A] [b]
red 0
blue 2
black 3
..... and so

now on your new sheet in the first row what you wnat the information enter
(here i assume A1 on sheet1 with the lookup table on sheet2 in columns a and
b.

=vlookup('sheet1'!A1,'sheet2'!A:B,2,false)
and then copy it down the column.

'sheet1'!A1 = the lookup value
'sheet2'!A:B = the lookup table
2 = the answer lookup is in the second column
false = find an exact match

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"vinnie123" wrote:

Hi all. I have a lot of data in columns in text format that I want to
code in to whole numbers.

eg. a lot of rows in say column A than contain either "red", "blue",
"black" etc.

I need a formula (ideally able to placed on a different sheet!) for
corresponding rows in a new column eg: C, that would say: if A1 "red"
then C1=0, if A1="blue" then C1=2, if A1="black" then C1=3 and so
forth with up to 20 arguments!.

Is this at all possiable.

Thanks. Vince


Reply
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
Formulae containing more than 7 arguments? Zakynthos Excel Worksheet Functions 4 April 4th 06 04:32 PM
Formulas that refer to (several) other columns for arguments... audreyglennette Excel Worksheet Functions 5 April 1st 06 04:04 AM
How to see the chart coding? ramkumar_cpt Charts and Charting in Excel 1 March 10th 06 12:12 PM
Arguments box on form Greshter Excel Discussion (Misc queries) 3 January 12th 06 11:03 PM
Passing Variable Number of Arguments to a Sub blatham Excel Discussion (Misc queries) 4 December 10th 05 10:36 AM


All times are GMT +1. The time now is 05:21 PM.

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"