ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If formula based on digits? (https://www.excelbanter.com/excel-programming/416172-if-formula-based-digits.html)

Hamed parhizkar

If formula based on digits?
 
Is there anyway to pull out certain digits based on rounding?

In A1...143.265 So my if would be =if(A1<0,A1,"")

However I only want the 2 digits after the decimal to pull. I know I can do
a middle, or right formula but how would this work if I had several rows some
with 1.199 and others with 145.258?

Please help

Nigel[_2_]

If formula based on digits?
 
This works for me

=LEFT((A1-INT(A1))*100,2)

--

Regards,
Nigel




"Hamed parhizkar" wrote in
message ...
Is there anyway to pull out certain digits based on rounding?

In A1...143.265 So my if would be =if(A1<0,A1,"")

However I only want the 2 digits after the decimal to pull. I know I can
do
a middle, or right formula but how would this work if I had several rows
some
with 1.199 and others with 145.258?

Please help



Sandy Mann

If formula based on digits?
 
Do you want them as whole numbers like 19 and 25 or as rounded numbers like
20 & 26 or even as decimale like 0.19 & 0.25 or rounded like 0.2 & 0.26?

For whole unrounded numbers use:

=INT(MOD(A1,1)*100)

For rounded whole numbers use:

=ROUND(MOD(A1,1)*100,0)

For unrounded decimals use:

=INT(MOD(A1,1)*100)/100

For rounded decimal numbers use:

=ROUND(MOD(A1,1),2)


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Hamed parhizkar" wrote in
message ...
Is there anyway to pull out certain digits based on rounding?

In A1...143.265 So my if would be =if(A1<0,A1,"")

However I only want the 2 digits after the decimal to pull. I know I can
do
a middle, or right formula but how would this work if I had several rows
some
with 1.199 and others with 145.258?

Please help




Rick Rothstein \(MVP - VB\)[_2675_]

If formula based on digits?
 
The two digits you want "pulled"... do you want them as Text or as Numbers.
I ask because there is a question of what to give you for something like
123.02 and 123.20, or 12.00, if you want them to be numbers after they are
"pulled".

Rick


"Hamed parhizkar" wrote in
message ...
Is there anyway to pull out certain digits based on rounding?

In A1...143.265 So my if would be =if(A1<0,A1,"")

However I only want the 2 digits after the decimal to pull. I know I can
do
a middle, or right formula but how would this work if I had several rows
some
with 1.199 and others with 145.258?

Please help




All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com