ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Decimal (https://www.excelbanter.com/excel-discussion-misc-queries/234993-decimal.html)

lightbulb

Decimal
 
I'm using a formula in column E that displays X in front of the number in
column B, and Y in front of the number in C. The issue is that some numbers
in B and C are decimals (2.36,10.01,101.75, etc.), but sometimes they are
whole numbers, 15,100,85, etc.). I need the data in column E to put a
decimal after the whole number, but no zeros...and I do not need another
decimal at the end of a decimal number...so basically if the number does not
already contain a decimal, I want it to put a decimal at the end....so if
column B read -140 and column C read 161.02...I want column E to read
"X-140.Y161.02"

Any help?

Luke M

Decimal
 
Assuming your limit is up to 2 decimals:

="X"&TEXT(B2,"0.##")&"Y"&TEXT(C2,"0.##")
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"lightbulb" wrote:

I'm using a formula in column E that displays X in front of the number in
column B, and Y in front of the number in C. The issue is that some numbers
in B and C are decimals (2.36,10.01,101.75, etc.), but sometimes they are
whole numbers, 15,100,85, etc.). I need the data in column E to put a
decimal after the whole number, but no zeros...and I do not need another
decimal at the end of a decimal number...so basically if the number does not
already contain a decimal, I want it to put a decimal at the end....so if
column B read -140 and column C read 161.02...I want column E to read
"X-140.Y161.02"

Any help?



All times are GMT +1. The time now is 09:58 AM.

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