I need to change the following field to text like this:
0-250000 to '$0 to $250,000'
I have to do it multiple times. Is there a way to automate this? For a variety of numbers..
I have been doing it manually and it takes a long time
CodePudding user response:
If you have TEXTSPLIT:
=TEXTJOIN(" to ",,DOLLAR(TEXTSPLIT(A1,"-"),0))
import pandas as pd
data = pd.read_excel('split.xlsx')
data1 = data['ColumnA'].str.split('-', expand=True)