String formatting in Excel - excel

I have a simple query.
How can I format the text in cells in my Workbook.
If my cell has text ABC, I want it in the format 'ABC'. Is there any formula for this?
I am using Excel 2010.
I cannot do find and replace as all the values I want to alter are unique

Edit the cell or column you need to format
choose format cell
Select Custom from the bottom
Use the formula '#' .
# represents your text

Use CONCATENATE. For example if the cell is A1 then the function would be:
=CONCATENATE("'", A1, "'")

Just to add value to lgor's answer as He's already made the point.
"#" represents the text.
Just go to format cells > custom and surround the # with two Apostrophes, like: '#' and it will work.

Related

Remove ' from cell, but keep cell content as text

I am looking to remove the ' before the content of a cell in order to do a VLookup, whowever when there are no letters it is turning the value into a number and the vlookup is retrieving inaccurate values. Any idea?
pre - '02364W105
post - 02364W105
pre - '151290889
post - 151290889 (this becomes 1.51E+08)
Change the cell format to Numbers and it does change the style. Normally it should work without it though.
You ha ve to select all these cells and change format to Number.
Probably they will still include the " ' " until you edit each one from the formula bar or pressing F2 and then ENTER.
The best way to avoid editing one by one is to write "1" into an empy cell, then copy it, then select all the cells you want to convert to number, then paste special, select "values" and "multiply".
This will convert all you cells with number formatted as text into numeric cells with numbers inside.

Custom Formatting in Excel

I need to format a certain column in excel such that:
Format is something like
hel 02/03
the cell must have three character string followed by space, followed by mm/dd.
How must my format look like?
instead to use a format you can create a concatenate column whit a formula that combine the two column :
=concatenate(C3;" ";text(D3;"mm/gg"))
where C3 contains Hel and d3 02/03. If the value is in the same cell i have to see how is formatted now on your sheet to suggest a different use of this formula.

Number value as text

I have a single cell with the value:
426,427,433,439,442
This isn't a number, rather a list of numbers. If I try to add another number to the list, for example, 679. Excel changes the cell to read:
679,426,427,433,439,000
If I select the cell and format it as "text", it changes to:
4.26427E+14
I've tried various cell formatting options, but I can't seem to get Excel to treat these numbers like text.
Copy and paste the column into Notepad, format a new column in Excel as text. In Notepad select all, copy it back out from Notepad into the column in Excel that you formatted for text.
First place a single quote (apostrophe) in front of the set of numbers and add the latest value at the end appropriate position.
add (apostrophe) in front of numbers
add (comma's) between
add any number by adding a (comma)
Possibly:
=LEFT(A1,3)&","&MID(A1,4,3)&","&MID(A1,7,3)&","&MID(A1,10,3)&","&MID(A1,13,3)
It seems you have a number 426427433439442 with the commas purely a presentational aspect of the formatting. I take it you want the commas and the only way now may be to insert them.

How to remove the first letter in each cell in a column in excel?

I have column in excel like below,
'04-Feb-01
'04-Mar-01
'08-Apr-01
'06-May-01
'03-Jun-01
'08-Jul-01
'05-Aug-01
I want to remove the character ' in all cells how can i do that?
I already tried with =RIGHT(A1,LEN(A1)-1) this one.. not working
Convert the text to a date using DATEVALUE. Then apply a date format to your liking.
When you enter data into a cell, Excel will try and convert it to the correct type (is it text, a number or a date) The single quote is Excel's way of saying treat what follows as text. It comes in handy when entering things like telephone numbers which Excel might think is a number and would not display leading zeros. In your the example the actual value in the cell is the text without the single quote, you can check this by copying a cell and then pasting into notepad and there would be no quote in the result.
Why do you want to remove the quote? If it is because you want the cells to contain a date rather than text you can convert it using the DATEVALUE function or by using copy and paste special values only .

Force Excel 2007 to treat all values in a column as text

I have a large column of data in Excel. This data should all be treated as text, but in some cells Excel is "magically" changing the data to numeric. This is screwing up my vlookpup() functions in another part of the spreadsheet, and I need to override Excel's automatic data type detection.
If I manually go through the cells, and append ' to each numeric cell, it works. I just don't want to do this by hand for several thousand cells.
For example, this works:
Manually type '209
And this does not work:
Manually type 209, right click and format as text.
If changing the format of the column is not an option, it's helpful sometimes to create another column that's 'vlookup friendly' and leave your main column alone.
This is a trick I've used a few times:
Say your 'mixed' column is column A.
In column B, enter the formula:
=CONCATENATE(A1)
or as Jean-François pointed out in a comment, the shorter version:
=A1 & ""
And drag it down for to the bottom row.
Column B will be all strings. The VLookup can then use column B.
Under the Data Tab, open the Text to Columns wizard and set the Column data format to Text. The destination cell can be set to the original data cell, but it will replace the original formatting with text formatting. Other aspects of formatting e.g. Bold, color, font, etc. are not changed using this method.
Setting the cells to "Text" format, as Jean mentioned, should work. The easiest way to do this, in any version of Excel, is:
Right-click cell, "Format Cells", "Number" tab, select "Text" format.
Have you tried setting the cells' number format to "Text"?
In Excel 2003: Format > Cells... > Number > Category: Text.
I don't have the more recent Excel versions, but it has to be something similar.
I tried all the above but didn't work. And then added an apostrophe before the number. Only then it changed to text from the exponential notation.
If you already have your data and manually adding a quote in front of your data in each cell is not an option you can use a helper column and write
="'"&A1
in B1, where A1 is the reference to your cell, and drag down the formula in B1 to the bottom. At this point you will see the quote, and you need to paste data in column B as values (CTRL+C & ALT+E+S and select values, or paste special as values from the top menu). Then find+replace a '(quote) with a '(quote) and you will have a column with values forced to text and a quote in front of each numeral representation of the number.
Updated for Office 365 / Excel 365:
CONCATENATE is being deprecated and replaced by CONCAT.
This method still works, i.e. I need 7E10 to appear as 7E10 and not 7.00E+10
Microsoft documentation source here.

Resources