Skip to main content
Solved

Question re using Substitute

  • March 17, 2023
  • 3 replies
  • 22 views

Forum|alt.badge.img+9
I imported a financial report from PayPal. All of the Negative amounts in the "Amount" field use a "-" in front of the value. I want to create a new field that removes the "-" and just lists the value of the Amount field.
 
If the amount doesn't have the "-" symbol, I just want it to leave the record blank.
 
I tried using a substitute formula in the new field, but not sure how to get a blank value in the new field if the original amount value does not have a "-" sign.
 
SUBSTITUTE(Amount, "-", " ")
 
What would be the best way to do this? Thanks in advance.

Best answer by Dimitris_Goudis

Hey @MettaSong

Did you try to use the ABS formula for that field. I recommend this because you actually want to have the absolute value from your negative number values. 

This solution will work either your field is number either it is text. 

Yours sincerely, 

Dimitris Goudis 

3 replies

Dimitris_Goudis
Forum|alt.badge.img+20
  • Inspiring
  • 260 replies
  • Answer
  • March 17, 2023

Hey @MettaSong

Did you try to use the ABS formula for that field. I recommend this because you actually want to have the absolute value from your negative number values. 

This solution will work either your field is number either it is text. 

Yours sincerely, 

Dimitris Goudis 


TheTimeSavingCo
Forum|alt.badge.img+31

Utilizing Dimitris solution of using ABS, you could put it inside an `IF()` like so:

IF( Amount < 0, ABS(Amount) )


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • 15 replies
  • March 17, 2023

Thank you @TheTimeSavingCo  & @Dimitris_Goudis - that is an elegant solution. I had never even considered the ABS formula. Perfect! I greatly appreciate your time and wisdom!