Skip to main content
The 2024 Developer Survey results are live! See the results
added 972 characters in body
Source Link
MGonet
  • 2.3k
  • 2
  • 2
  • 7

If your standard decimal separator is a period and your standard thousand separator is a comma, and you're grouping digits in groups of three you don't need to repeat the comma in numberformat definition. It is enough to use thousand separator once e.g. #,##0 or #,##0.000.
Number Format

I'm afraid it's not possible to use Hindi and American number formatting in the same worksheet. In addition to conditional formatting, you can also try to combine NumberFormat with the use of VBA. You can define UDFs (in a standard module) that will generate formatted numbers in text form (in US format).

Function FCur1(x)
   FCur1 = Format(x, "#,##0")
End Function

Function FCur2(x)
   FCur2 = Format(x, "#,##0.000")
End Function

When using functions directly in cells, the format should be General, right-aligned.
You can also define a macro that converts numbers into formatted texts. In this case, select the area you want to format and run the macro:

Sub Apply1()
   Dim rg As Range
   Selection.NumberFormat = "@"
   For Each rg In Selection
      rg.Value = FCur1(rg.Value)  ' or FCur2 as necessary
   Next rg
   Selection.HorizontalAlignment = xlHAlignRight
End Sub

If your standard decimal separator is a period and your standard thousand separator is a comma, and you're grouping digits in groups of three you don't need to repeat the comma in numberformat definition. It is enough to use thousand separator once e.g. #,##0 or #,##0.000.
Number Format

If your standard decimal separator is a period and your standard thousand separator is a comma, and you're grouping digits in groups of three you don't need to repeat the comma in numberformat definition. It is enough to use thousand separator once e.g. #,##0 or #,##0.000.
Number Format

I'm afraid it's not possible to use Hindi and American number formatting in the same worksheet. In addition to conditional formatting, you can also try to combine NumberFormat with the use of VBA. You can define UDFs (in a standard module) that will generate formatted numbers in text form (in US format).

Function FCur1(x)
   FCur1 = Format(x, "#,##0")
End Function

Function FCur2(x)
   FCur2 = Format(x, "#,##0.000")
End Function

When using functions directly in cells, the format should be General, right-aligned.
You can also define a macro that converts numbers into formatted texts. In this case, select the area you want to format and run the macro:

Sub Apply1()
   Dim rg As Range
   Selection.NumberFormat = "@"
   For Each rg In Selection
      rg.Value = FCur1(rg.Value)  ' or FCur2 as necessary
   Next rg
   Selection.HorizontalAlignment = xlHAlignRight
End Sub
Source Link
MGonet
  • 2.3k
  • 2
  • 2
  • 7

If your standard decimal separator is a period and your standard thousand separator is a comma, and you're grouping digits in groups of three you don't need to repeat the comma in numberformat definition. It is enough to use thousand separator once e.g. #,##0 or #,##0.000.
Number Format