Home > database >  How do I convert the following range to text?
How do I convert the following range to text?

Time:11-16

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))

enter image description here

import pandas as pd

data = pd.read_excel('split.xlsx')

data1 = data['ColumnA'].str.split('-', expand=True)

merge_value = "$" data1[0] " to " "$" data1[enter image description here

enter image description here

  • Related