two integers in one cell

K

KRK

Hello, I have Excel 2007

I am developing a spreadsheet in which it might (repeat might) be helpful to
put 2 integers into a single cell, and to access them independently from
elsewhere. I strongly suspect this is impossible (and probably daft!).

I know there are tricks I can play with formatting (hide cell boundaries
etc), or I could enter the 2 integers as a decimal number and access the
integer & decimal parts separately. eg if I want to enter 5 & 2, I enter
5.2, then use the integer function to 'split' it into 2 parts later.

Are there any facilities within Excel 2007 I don't know about that might
help ?

Thanks, and sorry if this has been a daft question

K
 
G

Gary''s Student

You can use the =CHOOSE() function to pick from several differenc values in a
single cell. Say we might want cell B9 to have the value 12 or 5674 or -33.

=CHOOSE(A1,12,5674,-33) depending on the value we put in A1.


Another option is to use a Data Validation pull-down.
 
K

KRK

This looks very useful, thanks,


KK



Gary''s Student said:
You can use the =CHOOSE() function to pick from several differenc values
in a
single cell. Say we might want cell B9 to have the value 12 or 5674
or -33.

=CHOOSE(A1,12,5674,-33) depending on the value we put in A1.


Another option is to use a Data Validation pull-down.
 
S

ShaneDevenshire

Hi KRK,

You can also consider VLOOKUP, HLOOKUP, INDEX or LOOKUP. For example if you
enter 1 in cell A1 and 2 in cell A2 then the formula:

=INDEX({1,4,7;2,5,8;3,6,9},A1,A2)

Would return the answer 4 the item in the 1st row, 2nd column of the array.

or

=VLOOKUP(A1,{1,4,7;2,5,8;3,6,9},A2,FALSE)

With the same data would return the same result.

or

=HLOOKUP(A1,{1,4,7;2,5,8;3,6,9},A2,FALSE)

which would return 2.

or

=LOOKUP(A1,{1;2;3;4;5},{"a";"b";"c";"d";"e"})

which would return b.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top