How to set the formula?

E

Eric

Does anyone have any suggestions on how to set the formula?
There is a list of possible numbers in cell A1, such as
0.01, 0.1, 1, 10, 100, 1000
and there is a given number in cell B1,
If 0.01 is inputed in cell A1 and 653.456 in cell B1, then return 653 in
cell C1.
If 0.1 is inputed in cell A1 and 653.456 in cell B1, then return 653 in cell
C1.
If 1 is inputed in cell A1 and 653.456 in cell B1, then return 653 in cell C1.
If 10 is inputed in cell A1 and 653.456 in cell B1, then return 653.5 in
cell C1.
If 100 is inputed in cell A1 and 653.456 in cell B1, then return 653.46 in
cell C1.
If 1000 is inputed in cell A1 and 653.456 in cell B1, then return 653.456 in
cell C1.

Does anyone have any suggestions on how to set the formula in cell C1?
Thanks in advance for any suggestions
Eric
 
D

Daniel.C

An ugly one ;-((
=CHOOSE(MATCH(A1,{0.001;0.01;0.1;1;10;100;1000},0),INT(B1),INT(B1),INT(B1),INT(B1),B1-MOD(B1,0.1),B1-MOD(B1,0.01),B1-MOD(B1,0.001))
Daniel
 
E

Eric

Thank everyone very much for suggestions
Could anyone please tell me how to display it using TEXT function?
I don't need to round the number, this number is to display only.
If the cell format sets to display no decimial, then it cannot show the
decimial at all even through it contains any decimials.
Does anyone have any suggestions on how to display it using TEXT function?
Thank everyone very much for any suggestions
Eric
 

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