How can excel tell that 59 is 50 and 9 (I need to act on the

rpwagner

New Member
Joined
Feb 28, 2002
Messages
22
Assume a1 value is 59. I need to determine that the number is 50 and 9. Then I will do something using the 50 and then something using the 9... It will always be a two digit number (01 through 59). Thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
What you could say is, if A1 = 59, then

=LEFT(A1)*10 will give you 50
=RIGHT(A1) will give you 9.

Rgds
AJ
This message was edited by AJ on 2002-03-23 08:37
 
Upvote 0
Great Aj just did a search and found the left and right but appreciate your help also. I didnt thing about the a1 * 10 for the 50 part.. tks once again
 
Upvote 0
Hi,

First digit
=LEFT(Range,1)*10

Last digit
=RIGHT(Range,1)+0

I assume that you handle the leading zeros already. The LEN of the cell value would need to be checked if not.

The +0 forces Excel to treat the value as a number, which it wouldn't if the argument cell was text.

Regards,
Jay
 
Upvote 0
On 2002-03-23 08:37, AJ wrote:
What you could say is, if A1 = 59, then

=LEFT(A1)*10 will give you 50
=RIGHT(A1) will give you 9.

Rgds
AJ
This message was edited by AJ on 2002-03-23 08:37

A bit simpler:

=LEFT(A1,2)+0
=RIGHT(A1)+0

to turn the left and right bits into numbers.

Aladin
 
Upvote 0
Hi Aladin:
Following up on this thread, rpwagner wants to see the place 10-digit 5 as 50, so your first line would be:

=(LEFT(A1)+0)*10, and the 0-place digit then
=RIGHT(A1)+0
 
Upvote 0
Actually, this works

=LEFT(A1)*10
=RIGHT(A1)+0

The '+0' is just an example math operation, therefor, there's no need to '+0' and then '*10' to get a real number
 
Upvote 0
You state that information is numbers.
If they are not text, consider the following:

59 in F2 =INT(F2/10) gives 5

and =MOD(F2,10) gives 9
 
Upvote 0
On 2002-03-23 08:57, Yogi Anand wrote:
Hi Aladin:
Following up on this thread, rpwagner wants to see the place 10-digit 5 as 50, so your first line would be:

=(LEFT(A1)+0)*10, and the 0-place digit then
=RIGHT(A1)+0

I see I misread rpwagner's query:

=LEFT(A1)*10 is just right.

Aladin
 
Upvote 0
Thanks Juan:
You are right -- there is no need to add that 0, even if the original entry was a text entry!
 
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top