View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default How to find the number?

On Tue, 31 Mar 2009 07:12:07 -0700, Eric
wrote:

Does anyone have any suggestions on how to find the number?

Example 1:
There is a number 19650 in cell A1, I would like to fit this number below
2025, therefore, it should return 1965 in cell B1.

Example 2:
There is a number 25624 in cell A1, I would like to fit this number below
2025, therefore, it should return 256 in cell B1.

Example 3:
There is a number 10.065 in cell A1, I would like to fit this number below
2025, therefore, it should return 1006 in cell B1.

Does anyone have any suggestions on how to set the formula to do it?
Thanks in advance for any suggestions
Eric


If by "fit below 2025" you mean multiply the number in A1 by the power of 10
that gets it as close to 2025 as possible, without going over, then this
**array-entered** formula does that (and returns the values you show in your
examples):



This formula must be **array-entered**:

=INT(A1*10^(10-MATCH(TRUE,A1*10^(10-ROW(INDIRECT("1:20")))<=2025,0)))

----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.
--ron