SUBSTITUTE a Blank space...

Aitch

Board Regular
Joined
Jan 27, 2019
Messages
119
Office Version
  1. 2010
Platform
  1. Windows
If I have a cell with two digits - how can I use the SUBSTITUTE function to add an extra character to make the cell have 3 digits?

So a cell with 11 would turn in to 011 or A11

Thanks for your help!
 
It is hard to know whether your formula is correct or not (aside from the 3 extra closing parentheses at the end) as we do not know exactly what you are trying to do (some clear cut before and after examples would be quite helpful). You changed from either all zeros or zeros with a leading "A" to not as many zeros as I think you want and one or two letter "O"s. Let me take a guess though... do either one of these do what you want.

=IF(AND(LEN(O31)<3,ISNUMBER(-O31)),TEXT(O31,"000"),O31)

or

=IF(AND(LEN(O31)<3,ISNUMBER(-O31)),TEXT(O31,"\A00"),O31)
 
Last edited:
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Thanks for the reply!

I've checked that the formula is text, and it's still not working...

This is the formula customised for my spreadsheet - is there a mistake in it?

=
IF(AND(LEN(O31)=1,ISNUMBER(-O31)),TEXT(O31,"\OO0"),IF(AND(LEN(O31)=2,ISNUMBER(-O31)),TEXT(O31,"\O0"),O31)))))

To understand it is necessary that you put some examples of what you have and what you expect of result.
Now, to evaluate your formula you must give an example of each case, listing what you have and what you expect of result.
 
Upvote 0
Hi

This may not be the best way but it is an easy solution.
you have to change the column where you have the row data to Text format instead of General and you will have the 05
 
Upvote 0
I removed the \ from the TEXT function and it seems to have solved the problem!

What does the \ do within the TEXT function? (Better check with you, in case it breaks something else!)

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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