Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Replace digit with Text

Status
Not open for further replies.

mcauliff

Programmer
Feb 26, 2007
71
0
0
US
I have a cell that contains the numbers, 1, 2, or 3. I want to replace the numbers with text.

I tried an If statement, but unable to get it to work

=IF("1","Compaq",IF("2","WWPS-Legacy",IF("3","WWPS-Oracle")))

Do I need to put the text in a different cell. I'm trying to replace the numbers with the text.
 
you need to tell excel which cell you are refering to

=IF(A1=1,"Compaq",IF(A1=2,"WWPS-Legacy","WWPS-Oracle"))

hth
 



Hi,

"... I want to replace the numbers with text."

You CANNOT do this in the cell in which the numbers reside.

You CAN do this in ANOTHER CELL, leaving the ORIGINAL CELL VALUE unchanged as onedtent suggested.
[tt]
IN B1, for instance: =IF(A1=1,"Compaq",IF(A1=2,"WWPS-Legacy","WWPS-Oracle"))
[/tt]

Skip,
[sub]
[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue][/sub]
 
Thanks to everyone that reply.

I thought that I woudl have to use another cell for the text and since the text is in a different cell, than needed to add the cell number that contained the data (A1).

The unmention item was the cells were being created from a SQL Query and I wasn't sure in I add a column to the output if it would disappear when the query was refreshed.
 




If your column is directly adjacent and to the right of the querytable range, AND you check the checkbox in Data > Get External Data > Data Range Properties, you will always get your formula calculated thru the rows of returned data from the query.

Skip,
[sub]
[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top