Adding two numbers as decimal

valmir

Board Regular
Joined
Feb 10, 2021
Messages
239
Office Version
  1. 365
Platform
  1. Windows
Hello everyone! I wonder if there is a way in excel to add two numbers and have the result as a decimal number in which the first number will be the whole number part and the second number will be the decimal number part. Example: I have "2" in column A and "5" in column B, the result in column C will be "2,5". I tried to do this with this formula
=TEXTJOIN(","; TRUE; A1:B1)
But the result does not come as number, but rather as text and behaves as text which does not serve my purpose.
Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try this

=TEXTJOIN(","; TRUE; A1:B1)*1

or

= TEXT(TEXTJOIN(","; TRUE; A1:B1), "0.00")
 
Upvote 0
This works for me...
=VALUE(A1&B1)*1/VALUE("1"&REPT("0";LEN(B1)))
 
Upvote 0
Wow! I never thought that this would be so hard to achieve. I tried all those formulas and none of them is working. For example when adding "0" and "3" I was supposed to get 0,3 but I am getting 0 as the result
 
Upvote 0
Do you have your result cell formatted to show decimals?
 
Upvote 0
Correction...
=IFERROR(VALUE(A1&B1)*1/VALUE("1"&REPT("0";LEN(B1)));"")
As Rory say format cell decimal places.
 
Last edited:
Upvote 0
Solution
=VALUE(A1)+B1*1/VALUE("1"&REPT("0";LEN(B1)))
Yes sir, this one works. Just one problem. When adding for example 13 and 1, I am getting 13 only. Could that be a formatting issue? I have formatted as a number with one decimal place. Can you test this specific example to see if you will get "13,1", please?
 
Upvote 0
Try to increase decimal places in the cell with this formula.
 
Upvote 0
Try to increase decimal
Increasing the decimal places gives me "13,01" instead of "13,1". I wonder if there is a custom format to get it right. And increasing the decimal places messes up with the sorting!
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,962
Members
449,200
Latest member
indiansth

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