Removing Decimals and Calculating Prime Number Fields

D

Data Analyst

I'm using the following formula to remove decimals from my fields (ex.
1000.02.09.03):

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

I need to include in it the fields that don't have decimals (ex. 1000) to be
calculated as is instead of receiving the error message #VALUE!
 
F

Fred Smith

To remove the decimals (as requested), use Substitute. For example, to
change it to the number 1000020903, use:
=--substitute(a1,".","")

Regards,
Fred
 
D

Data Analyst

Found it! It's =LEFT(A1,6)

6 is the number of characters that will be used from Left to Right
 
F

Fred Smith

Why not =left(a1,4)? That will give you the same value.

Also, Left returns text. If you want to use it as a number in calculations,
use:
=--left(a1,4)

I still think you are better off checking for the decimal point, as shown in
previous posts.

Regards,
Fred
 

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