Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default HOW DO I CONVERT A NUMBER'S MOST SIGNIFICANT DIGIT TO A SINGLE DI.

I am trying to work a problem for a random number generator. Essentially,
the random number is being generated by using two random number generators (X
= 1 to 100 and Y = 1 to 100) and then dividing X by Y to get a seed for the
random nujber.

I need to take the most significant digit of the number and convert it to an
integer between 1 and 9.

Any idea as to how I can do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default HOW DO I CONVERT A NUMBER'S MOST SIGNIFICANT DIGIT TO A SINGLE DI.

First stop using capitals, as it is considered yelling.

Tyro

"maxq777" wrote in message
...
I am trying to work a problem for a random number generator. Essentially,
the random number is being generated by using two random number generators
(X
= 1 to 100 and Y = 1 to 100) and then dividing X by Y to get a seed for
the
random nujber.

I need to take the most significant digit of the number and convert it to
an
integer between 1 and 9.

Any idea as to how I can do this?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default HOW DO I CONVERT A NUMBER'S MOST SIGNIFICANT DIGIT TO A SINGLE DI.

On Sat, 22 Mar 2008 18:53:01 -0700, maxq777
wrote:

I am trying to work a problem for a random number generator. Essentially,
the random number is being generated by using two random number generators (X
= 1 to 100 and Y = 1 to 100) and then dividing X by Y to get a seed for the
random nujber.

I need to take the most significant digit of the number and convert it to an
integer between 1 and 9.

Any idea as to how I can do this?



I believe:

=--MID(A1,MIN(SEARCH({1,2,3,4,5,6,7,8,9},A1&"12345678 9")),1)

will return the most significant digit as an integer.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default HOW DO I CONVERT A NUMBER'S MOST SIGNIFICANT DIGIT TO A SINGLE DI.

Just out of curiosity, in which random number function are you using this
"seed" value?

Rick


"maxq777" wrote in message
...
I am trying to work a problem for a random number generator. Essentially,
the random number is being generated by using two random number generators
(X
= 1 to 100 and Y = 1 to 100) and then dividing X by Y to get a seed for
the
random nujber.

I need to take the most significant digit of the number and convert it to
an
integer between 1 and 9.

Any idea as to how I can do this?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default HOW DO I CONVERT A NUMBER'S MOST SIGNIFICANT DIGIT TO A SINGLEDI.

Hello,

Another solution might be
=--LEFT(TEXT(ABS(A1),"0.000000000000000E+0"),1)

Regards,
Bernd
Reply
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
NEED EXCEL FORMULA TO CONVERT 13 DIGIT ISBN TO 10 DIGIT ISBN Don_Quixote60 Excel Discussion (Misc queries) 7 April 1st 07 10:58 PM
Can only put a single digit/letter in worksheet 2007 Igor Quasimodo New Users to Excel 1 February 6th 07 07:17 PM
Convert 2 digit month to 4 digit years and months BB Excel Worksheet Functions 2 September 17th 06 09:33 PM
how to convert single digit to month name cygnus Excel Worksheet Functions 4 April 27th 06 05:16 PM
Color a single digit in a mult-digit number cell Phyllis Excel Discussion (Misc queries) 6 November 17th 05 12:46 AM


All times are GMT +1. The time now is 07:00 PM.

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

About Us

"It's about Microsoft Excel"