LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 279
Default Mapping integers to strings

I run Excel 2003 on a Windows Vista system.

I have an application in which I want to map non-negative integers to
text. I tried using OFFSET.

A B C D E
1 Clubs Dimonds Hearts Spades NoTrump
2 0 Clubs

B2 is =OFFSET($A$1,0,$A$2,1,1)
I use 0 for cols to show the problem with the next part.
If B3 is =OFFSET({"Clubs"},0,$A$2,1,1), I hoped to do something similar
with a constant array but get "The formula you typed contains an error".
I accepted the error that Excel gives me because OFFSET help says:

"OFFSET(reference,rows,cols,height,width)

Reference is the reference from which you want to base the offset.
Reference must refer to a cell or range of adjacent cells; otherwise,
OFFSET returns the #VALUE! error value."

It seems, Excel does not accept an array constant as equivalent to a
cell or range of cells in an OFFSET call. I think it should as "About
array formulas and array constants" help says "Array constants can be
used in place of references when you don't want to enter each constant
value in a separate cell on the worksheet".

I am looking for a better way of including array constants within
formulas, rather than in cells.

I don't like
=IF($A$2=0,"Clubs",IF($A$2=1,"Dimonds",IF($A$2=2," Hearts",IF($A$2=3,"Spa
des","NoTrump"))))
or
=IF($A$2<2,IF(A2=0,"Clubs","Dimonds"),IF($A$2<4,IF ($A$2=2,"Hearts","Spad
es"),"NoTrump"))
and I don't want a user-defined function (UDF) either.

I am looking for some simple means to get a member from a constant array
in a worksheet. e.g. something like ={"Clubs"}(0) or ={"Clubs"}(1).
--
Walter Briscoe
 
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
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
Seems there is a bug with long integers in VBA Alex Excel Programming 6 May 9th 07 01:40 AM
How to find number of pairs of strings from list of strings? greg_overholt Excel Worksheet Functions 5 January 27th 06 10:42 PM
A list of Consecutive Integers, can I search for missing integers CM Excel Worksheet Functions 4 September 2nd 05 06:38 PM


All times are GMT +1. The time now is 10:29 PM.

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

About Us

"It's about Microsoft Excel"