Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-06-2018, 06:18 AM
Alsadius Alsadius is offline Find last three digits after . ( including zero) Windows 7 64bit Find last three digits after . ( including zero) Office 2010 32bit
Novice
 
Join Date: Nov 2017
Posts: 25
Alsadius is on a distinguished road
Default

Quote:
Originally Posted by LearnerExcel View Post
Code:
 
=A1-TRUNC(A1)
Problem resolved.
That'll get him all decimals, not just the last three.

Assume we're dealing with 123.456789.

=A1-TRUNC(A1)
will result in 0.456789

=ROUND(A1-TRUNC(A1), 3)
will result in 0.457 (it rounds it off to three decimal places)

=(TRUNC((A1-TRUNC(A1))*1000))/1000
will result in 0.456 (this is a nasty formula, but it basically shifts the decimal three places and re-truncates)

=RIGHT(A1-TRUNC(A1), 3)
should result in 789 (though this one gave me a floating-point error when I tried it, which may mean it's bug-prone in practice and needs caution)

Which one you want depends on exactly what you're trying to do, but hopefully that should cover all the bases.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Having number's digits together mohsen.amiri Word 0 06-23-2017 01:20 AM
Find last three digits after . ( including zero) Digits are not found in my document! reza8615953 Word 3 04-18-2017 10:48 AM
Macro for find/replace (including headers and footers) for multiple documents jpb103 Word VBA 2 05-16-2014 04:59 AM
Multi-Doc Find/Replace, Including Headers/Footers & Textboxes konopca Word VBA 3 05-05-2014 03:18 PM
Find last three digits after . ( including zero) Problems merging in last 4 digits of an account higher than 16 digits Glynda Mail Merge 1 04-08-2011 12:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft