Skip to main content
Solved

Formula show #ERROR! when Substitute from a Number Field


Hello community,

what do I wrong? 🙂 

I have a field with #Numbers f.e. 80 or 80,1

In another field I try to format this field to a url format, that means I would like to replace the , with an -.

For this I use the Substitute formula:

SUBSTITUTE({Numbers}, ",", "-")
 
No matter how I format the Numbers field, I always get #ERROR!
 
Can someone help me with this ðŸ¤— 
Many thanks in advance!

Best answer by BillH

BillH wrote:

Formatting doesn't change the contents, only the way the contents are displayed.  You are getting an error because you are using a text formula on a number.   If you try SUBSTITUTE({Numbers&""}, ",", "-") I believe it will work.  (You are casting the number field to a text value.)

 


Sorry, suggested formula should be SUBSTITUTE({Numbers}&"", ",", "-")

View original
Did this topic help you find an answer to your question?

4 replies

BillH
Forum|alt.badge.img+11
  • Brainy
  • 172 replies
  • November 9, 2023

Formatting doesn't change the contents, only the way the contents are displayed.  You are getting an error because you are using a text formula on a number.   If you try SUBSTITUTE({Numbers&""}, ",", "-") I believe it will work.  (You are casting the number field to a text value.)

 


  • Author
  • New Participant
  • 2 replies
  • November 9, 2023
BillH wrote:

Formatting doesn't change the contents, only the way the contents are displayed.  You are getting an error because you are using a text formula on a number.   If you try SUBSTITUTE({Numbers&""}, ",", "-") I believe it will work.  (You are casting the number field to a text value.)

 


Hi BillH, 

Thank you for your tip. It was almost right, your formula is just not quite correct. The characters & "" must be outside the {} in this case. So like here: SUBSTITUTE({Numbers} &"",",", "-")

Now it works for me too and I no longer get Error! Thanks again!


BillH
Forum|alt.badge.img+11
  • Brainy
  • 172 replies
  • November 9, 2023

 

Sorry for the typo, I wasn't paying attention during my cutting and pasting lessons.  

Glad it worked eventually.


BillH
Forum|alt.badge.img+11
  • Brainy
  • 172 replies
  • Answer
  • November 9, 2023
BillH wrote:

Formatting doesn't change the contents, only the way the contents are displayed.  You are getting an error because you are using a text formula on a number.   If you try SUBSTITUTE({Numbers&""}, ",", "-") I believe it will work.  (You are casting the number field to a text value.)

 


Sorry, suggested formula should be SUBSTITUTE({Numbers}&"", ",", "-")


Reply