Conditional move of decimal point in a formula?

robdav

New Member
Joined
Dec 1, 2017
Messages
15
I have numbers in a column where the decimal place is in a different position e.g. 1.97696 and 12719.50. I’m trying to right a conditional formula which can detect where the decimal point is and move it before doing the calculation.

So for example, the first number 1.97696 would need to be 19769.60 and 12719.50 stays as it is because the decimal point is in the right place.

I don’t think I can do it with a custom number format on the one column.

Any help would be appreciated.

Thanks

Rob
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
curious as to why the decimal would be in the wrong place ?
 
Upvote 0
Moving the decimal point with formatting of any kind will not change the value in the cell, only the appearance. Any calculation performed would still be done on the original value.

How do we know that 1.97696 should be 19769.60 and not 1976.96? Should it always be 5 digits before the decimal point? If yes, then you could use something like

=(LEFT(SUBSTITUTE(1.97696,".","")&"0000000",7)/100) as a correction factor in your calculations.
 
Upvote 0
Well I suppose they aren't but in order to compare apples with apples, in a calcultion, the decimal point needs to be in the same place. Does that make sense?
 
Upvote 0
Moving the decimal point with formatting of any kind will not change the value in the cell, only the appearance. Any calculation performed would still be done on the original value.

How do we know that 1.97696 should be 19769.60 and not 1976.96? Should it always be 5 digits before the decimal point? If yes, then you could use something like

=(LEFT(SUBSTITUTE(1.97696,".","")&"0000000",7)/100) as a correction factor in your calculations.

Correct, there should always be 5 digits before the decimal point. How would I apply your formula to the whole column where some might already be in the correct format and others not, would I need a helper column? Thanks.
 
Upvote 0
Correct, there should always be 5 digits before the decimal point. How would I apply your formula to the whole column where some might already be in the correct format and others not, would I need a helper column? Thanks.

I'm there, many thanks for your help!
 
Upvote 0
A helper column would be the easiest way, the formula should always give the correct result based on a desired 00000.00 format, anything already in the correct format should remain unchanged.
 
Upvote 0
Well I suppose they aren't but in order to compare apples with apples, in a calcultion, the decimal point needs to be in the same place. Does that make sense?
IMHO by changing the actual value, you will be comparing differences of exponential levels making 0.1 = to 1 and 10 and 100 which obviously they are not
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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