Forum Discussion

Swayambodh's avatar
Swayambodh
Copper Contributor
Oct 01, 2023

How can we reduce the font size of decimal value ?

How can we reduce the font size of Decimal Value in excel? (Just like its shown in image)

    • HansVogelaar's avatar
      HansVogelaar
      MVP

      NikolinoDE 

      Niko, please note that the values in your sample workbook are text values. They are left-aligned while horizontal alignment is set to General, and the formula =SUM(A1:A3) returns 0.

      If I convert the values to numbers, your macro has no effect.

      • NikolinoDE's avatar
        NikolinoDE
        Gold Contributor
        You're absolutely right, my mistake. Too focused on the point and not on the task. I apologize for the confusion. Adjusting the font size for certain parts of the number is not a built-in function in Excel's VBA, or is there a way?...to do this with VBA.
  • Swayambodh 

    Many things are possible  That is not to say they are worth doing!  For example, you could commit separate columns for dollars and cents and format each as you like.

    summing the column would require a bit of effort though.

    Sum2PartsĪ»(amount)
    = LET(
        values, TAKE(twoCol, , 1) + ROUND(TAKE(twoCol, , -1) / 100, 2),
        result, SUM(values),
        HSTACK(INT(result), ROUND(100 * (result - INT(result)), 0))
      )

    [ Note: the integer cents are formatted using the number format "\.00" ]

  • Swayambodh 

    It is impossible to do that with numbers.

    It would be possible if you converted the number to a text value, but that would cause problems with calculations:

     

Resources