ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Number Transformation (https://www.excelbanter.com/excel-discussion-misc-queries/146796-number-transformation.html)

Saxman

Number Transformation
 
By entering a numerical value in a cell A1, I would like to see another value
displayed in cell B1.

For instance, a 1 in A1 would display 11 in B1.

1 = 11
2 = 8
3 = 7

Else = 0 set below.

4 = 0
5 = 0
6 = 0
7 = 0
8 = 0
9 = 0
0 = 0

Might this be possible with ISERROR?
--


Rick Rothstein \(MVP - VB\)

Number Transformation
 
By entering a numerical value in a cell A1, I would like to see another
value
displayed in cell B1.

For instance, a 1 in A1 would display 11 in B1.

1 = 11
2 = 8
3 = 7

Else = 0 set below.

4 = 0
5 = 0
6 = 0
7 = 0
8 = 0
9 = 0
0 = 0


Put this in B1...

=IF(A1=1,11,IF(A1=2,8,IF(A1=3,7,0)))

and copy it down.

Rick


Stan Brown

Number Transformation
 
Sun, 17 Jun 2007 13:39:31 -0500 from Saxman
:
By entering a numerical value in a cell A1, I would like to see
another value displayed in cell B1. For instance, a 1 in A1 would
display 11 in B1.
1 = 11
2 = 8
3 = 7


I guess you mean "transforms to" rather than "equals".

4 = 0

....
0 = 0

Might this be possible with ISERROR?


It might, but I think it's easier with LOOKUP. :-)

Put this in B1:

=LOOKUP(A1,{0,1,2,3,4},{0,11,8,7,0})

The first array is the "look-for" values, and the second is the
"transform to" values. If A1 is greater than 4, LOOKUP uses the
"transform-to" value that corresponds with the "look-for" value of 4,
which is the 0 you specified.

Limitations: If A1 is negative you'll get #N/A in B1. If A1 is not a
whole number you'll get something in B1 that corresponds to the next
lower number. For example, 2.2 in A1 puts 8 in B1.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/

Earl Kiosterud

Number Transformation
 
Saxman,

=CHOOSE(A2,11,8,7,0,0,0,0,0,0)

This won't handle 0 or above 9 or blank. So:

=IF(AND(A3=1,A3<=9),CHOOSE(A3,11,8,7,0,0,0,0,0,0) ,0)
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Saxman" wrote in message
...
By entering a numerical value in a cell A1, I would like to see another value
displayed in cell B1.

For instance, a 1 in A1 would display 11 in B1.

1 = 11
2 = 8
3 = 7

Else = 0 set below.

4 = 0
5 = 0
6 = 0
7 = 0
8 = 0
9 = 0
0 = 0

Might this be possible with ISERROR?
--




Bernd P

Number Transformation
 
Hello,

Put into C1:D4
1 11
2 8
3 7
4 =A1

Then enter into B1
=VLOOKUP(A1,C1:D4,2,0)

Regards,
Bernd


Saxman

Number Transformation
 
Earl Kiosterud wrote:

=IF(AND(A3=1,A3<=9),CHOOSE(A3,11,8,7,0,0,0,0,0,0) ,0)


This works fine by pasting into B1,B2,B3 and amending the function.

Thanks.

--


Bernd P

Number Transformation
 
On 17 Jun., 21:14, Bernd P wrote:
Hello,

Put into C1:D4
1 11
2 8
3 7

=A1 Errormessage

Then enter into B1
=VLOOKUP(A1,C1:D4,2,0)

Regards,
Bernd




Earl Kiosterud

Number Transformation
 
Saxman,

Glad to hear it. Thanks for the feedback.

The VLOOKUP solutions that have been offered would certainly be the way to go if you had a
lot of values, and if you do get more, you should probably switch to that solution. The
IF/AND/CHOOSE solution I offered would start to get messy and difficult to update when
things change, whereas the table with VLOOKUP is a clean way of handling it.
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Saxman" wrote in message
...
Earl Kiosterud wrote:

=IF(AND(A3=1,A3<=9),CHOOSE(A3,11,8,7,0,0,0,0,0,0) ,0)


This works fine by pasting into B1,B2,B3 and amending the function.

Thanks.

--




Saxman

Number Transformation
 
Earl Kiosterud wrote:

Saxman,

Glad to hear it. Thanks for the feedback.

The VLOOKUP solutions that have been offered would certainly be the way to go if
you had a lot of values, and if you do get more, you should probably switch to
that solution. The IF/AND/CHOOSE solution I offered would start to get messy and
difficult to update when things change, whereas the table with VLOOKUP is a clean
way of handling it.


My data will remain static, so the solution is just fine. Thanks for replying.

--



All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com