Skip to main content
Answer

Currency Formula

  • December 6, 2025
  • 2 replies
  • 32 views

Forum|alt.badge.img+8

Hi all,

 

I import CSV files with salary ranges.

There are two fields from CSV: “Salary Min” & “Salary Max”. Their format is $75,000.00.

 

I want to have them in one field ($75,000 - $100,000), so created a third field with the formula

 

IF(
  AND({Salary Min}, {Salary Max}),
    "$" & {Salary Min} & " - $" & {Salary Max} & "/yr",
    ""
)

 

However,  I get “$75000 - $100000/yr”.

I looked around and tried AT’s AI but so far luck.

Is there a way I can resolve this?

 

Thanks a lot

 

Best answer by TheTimeSavingCo

Try this:

IF(
AND({Salary Min}, {Salary Max}),
"$" &
REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE(ROUND({Salary Min})&"", "(\\d{3})$", ",$1"), "(\\d*)(\\d{3}),", "$1,$2," ), "(\\d{1,3})(\\d{3}),", ",$1,$2," ), "(\\d{1,3}),(\\d{3}),", "$1,$2," ), "^(\\d{1,3})(\\d{3}),", "$1,$2," ), "^,", "" ) & " "
&
" - $" &
REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE(ROUND({Salary Max})&"", "(\\d{3})$", ",$1"), "(\\d*)(\\d{3}),", "$1,$2," ), "(\\d{1,3})(\\d{3}),", ",$1,$2," ), "(\\d{1,3}),(\\d{3}),", "$1,$2," ), "^(\\d{1,3})(\\d{3}),", "$1,$2," ), "^,", "" ) &
"/yr"
)



Credit to ​@Sho who made that formula here: 

 

2 replies

TheTimeSavingCo
Forum|alt.badge.img+31

Try this:

IF(
AND({Salary Min}, {Salary Max}),
"$" &
REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE(ROUND({Salary Min})&"", "(\\d{3})$", ",$1"), "(\\d*)(\\d{3}),", "$1,$2," ), "(\\d{1,3})(\\d{3}),", ",$1,$2," ), "(\\d{1,3}),(\\d{3}),", "$1,$2," ), "^(\\d{1,3})(\\d{3}),", "$1,$2," ), "^,", "" ) & " "
&
" - $" &
REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE( REGEX_REPLACE(ROUND({Salary Max})&"", "(\\d{3})$", ",$1"), "(\\d*)(\\d{3}),", "$1,$2," ), "(\\d{1,3})(\\d{3}),", ",$1,$2," ), "(\\d{1,3}),(\\d{3}),", "$1,$2," ), "^(\\d{1,3})(\\d{3}),", "$1,$2," ), "^,", "" ) &
"/yr"
)



Credit to ​@Sho who made that formula here: 

 


Forum|alt.badge.img+8
  • Author
  • Known Participant
  • December 6, 2025

Yes, yes, yes.

 

This works.

 

Thanks a lot.