Forum Discussion
Reducing multiple decimal points in a value
Hi All
Would anyone know of a formula in Excel or PowerBI where we can reduce a value of multiple decimal points to just one? I have tried all the usual formulae in Excel but cant seem to locate the right command.
Its where a software version of a product is 5.1.6.5 for example, and I would like to display it as just 5.1
Thanks
GavinMc460 Perhaps this:
=LEFT(A1,FIND(".",A1,3)-1)
where A1 contains the version number and the first period never occurs after the third character in the text string.
6 Replies
- Riny_van_EekelenPlatinum Contributor
GavinMc460 Perhaps this:
=LEFT(A1,FIND(".",A1,3)-1)
where A1 contains the version number and the first period never occurs after the third character in the text string.
- GavinMc460Copper Contributor
Riny_van_Eekelen , thanks very much. That worked perfectly
- SergeiBaklanDiamond Contributor
What is the logic, trim everything starting from second found dot?
- GavinMc460Copper ContributorThat was it exactly Sergei, many thanks.
- SergeiBaklanDiamond Contributor
To be more safe with number of digits between dots I'd modify as
=LEFT(A1,FIND("@",SUBSTITUTE(A1,".","@",2),2)-1)
- Riny_van_EekelenPlatinum Contributor
SergeiBaklan Ooops! Now my screen had not refreshed. So I didn't see your response pointing in the same direction I was thinking.