title: Custom number (price) format independent of localization
body: <p>I am wondering is it possible to have custom number format using Excel formula that will not be dependent on localization of Excel application (EU/US)?</p>
  <p>For example I have value 1291660.</p>
  <p>Then using formula <code>=TEXT(A1;&quot;# ##0,00&quot;)</code>. I get as an output <code>1 291 660,00</code>. The target is to have in any case <code>1.291.660,00</code> as an output. Any Excel professional to give an advice?</p>
  <p>I have tried <code>=TEXT(A1;&quot;#.##0,00&quot;)</code> - This didn't work</p>
  <p>I think VBA is the only solution to this. I have found my old question about the same topic, but it seems that solution provided is not working for some reason?</p>
  <p><a href="https://stackoverflow.com/questions/63436786/ultimate-1000-separator-using-vba">Ultimate 1000 separator using VBA</a></p>
  <pre><code>Function CustomFormat(InputValue As Double) As String
      Dim sThousandsSep As String
      Dim sDecimalSep As String
      Dim sFormat As String
      
      sThousandsSep = Application.International(xlThousandsSeparator)
      sDecimalSep = Application.International(xlDecimalSeparator)
      
      ' Up to 6 decimal places
      sFormat = &quot;#&quot; &amp; sThousandsSep &amp; &quot;###&quot; &amp; sDecimalSep &amp; &quot;######&quot;
      
      CustomFormat = Format(InputValue, sFormat)
      If (Right$(CustomFormat, 1) = sDecimalSep) Then
          CustomFormat = Left$(CustomFormat, Len(CustomFormat) - 1)
      End If
      
      ' Replace the thousands separator with a space
      ' or any other character
      CustomFormat = Replace(CustomFormat, sThousandsSep, &quot; &quot;)
  End Function
  </code></pre>
  <p>By replacing <code>CustomFormat = Replace(CustomFormat, sThousandsSep, &quot; &quot;)</code> with <code>CustomFormat = Replace(CustomFormat, sThousandsSep, &quot;.&quot;)</code> output is <code>.1 291 660</code></p>