Extracting characters from left and right of a decimal point

ronnie_m

New Member
Joined
Sep 8, 2005
Messages
1
Hi Folks
In Excel 2000, I need to select the values on either side of a decimal point in a number formatted as either number (2 dec. places) or custom (###.##) to use subsequent calculations. The LEFT function works well enough when the number of places to the left is constant, but because the portion to the right can vary from 1 to ?(15 I think) places, subsequent calculations based on RIGHT are inaccurate. Any ideas??
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
try this

=RIGHT(A1,LEN(A1)-FIND(".",A1))

and this

=LEFT(A1,FIND(".",A1)-1)

Note: this turns the data into TEXT....

you stated you were going to do calcs....try this
=VALUE(RIGHT(A1,LEN(A1)-FIND(".",A1)))
and
=VALUE(LEFT(A1,FIND(".",A1)-1))

NOTE: you could also try TEXT to COLUMNS with the decimal point as your delimiter
 
Upvote 0
Instead of using string functions, try this:

To get the number to the left of the decimal point:

=INT(A1)

to get the numbers after the decimal point:
=A1-INT(A1)
 
Upvote 0
HOTPEPPER said:
Instead of using string functions, try this:

To get the number to the left of the decimal point:

=INT(A1)

to get the numbers after the decimal point:
=A1-INT(A1)

Nice...always forget about INT....
 
Upvote 0
for the decimal portion, you may also use the modulo function which returns the remainder (remember long division) from a division calculation.

for example:
=MOD(10,3) => 1

__3_ R1
3)10
9
----
1

This is normally only used with integers (whole numbers, no decimals), but the Excel function take floating point numbers (with decimals) as well, so
=MOD(10.1, 3) => 1.1

and to get what you are looking for, use this:

=MOD(A1,1)
 
Upvote 0

Forum statistics

Threads
1,222,617
Messages
6,167,079
Members
452,094
Latest member
Roberto Saveru

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