Forum Discussion

LesHughes's avatar
LesHughes
Copper Contributor
Oct 07, 2022
Solved

Auto cell formatting

Is it possible to format a number in a cell by number of decimal places, where the number of decimal places is stored in a different cell?   I enter a load of data in rows into a tab ("data") that ...
  • dscheikey's avatar
    dscheikey
    Oct 07, 2022

    LesHughes 

    Another possibility would be:

    =TEXT(A1,"#,##0"&IF(B1=0,"","."&REPT("0",B1)))
    A1=66
    B1=5
    Result=66.00000

    With the disadvantage that the number is then converted to a text. But maybe that doesn't bother you.

Resources