Numbers to Text

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
221
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have having a bit of an issue with a formula.

My raw data file I have downloaded appears as text format when there is a 0, 00 prefix or if there is a letter prefix.

However, if there is a standard number then it formats this as a number (natural). My look up file is based only on text format. And so I need a formula to convert the number to text.

Looking on the internet this gives a very basic =TEXT(Cell,"0"). However, when this is appllied to a cell which has a 0, or 00 then it keeps the text format, but removes the 0's

What formula can I use? As you can see below it has converted X90 to text in Y90 (But in Y89 it has removed the 00 which I dont want)

Numbers.PNG
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
See if this works for you.

Excel Formula:
=IF(ISTEXT(X89),X89,TEXT(X89,"0"))

or
Excel Formula:
=Trim(X89)
 
Last edited:
Upvote 0
Solution
See if this works for you.

Excel Formula:
=IF(ISTEXT(X89),X89,TEXT(X89,"0"))
Both work fine, I managed a long winded way which was similar to your IF statement. However, I created another column which was telling me true / false if it was ISTEXT, then an if statement based on a FALSE response. So a bit more long winded, and I should have incorporated in the formula as you have done.

However, the TRIM option is much more simple, and seams to work as expected.
 
Upvote 0
I am sure that if you have a lot of data that Peter's formula will be faster. I have just gotten into the habit of using Trim since it cleans up additional spaces at the same time which is often an issue when you get data from other sources.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top