Remove dot and keep leading zero in Excel - excel

I have a column in Excel with values that looks like this:
01.01
01.02
01.03
01.04
01.05
01.06
0101.2
0101.21.00
0101.21.00.00
0101.29.00
0101.29.00.10
I am trying to remove the "." in the 4 digit cells i.e. 01.01 01.02 etc. so that they will show 0101, 0102 instead. The current cells indicated "General" format. I changed it to "text". Then tried to do a replace "." to blank. However, it will change from 01.01 to 101. I have tried several methods including "custom" format to no avail.
I filtered the column so only those cells with length=5 show up. I then applied a "custom" format 0000 to the cells. It changed. However, I then tried to sort the column, it will not sort properly. The custom formatted 4-digit cells are conflicting with other cells.
I only need to remove the "." for those 4-digit cells and keeping the leading zero. Seems like an easy task but I am pulling my hair. Any advise is appreciated.

Different interpretation:
=IF(MID(A1,3,1)=".",REPLACE(A1,3,1,),A1)
May sort as you require.
Change ,s for ;s if necessary for your configuration.

When A1 is your target cell,
B1=SUBSTITUTE(A1,".","")
In my photo Column A is formatted as Text and Column B is good ol' fashion General

Related

How to make excel stop treating column as date

My column values are as follows:
1-1
1-2
2-1
2-2
...
12-1
12-2
13-1
13-2
...
n-1
n-2
On cells containing 1-1 up to 12-2, excel doesn't meddle with me, but starting on 13-1 up to the nth row, it shows warning "Text date with 2-digit year". Unfortunately, this are really not dates. Also, I already tried formatting the said rows/cells as text before inputting any values, but really when excel sees "13-1" and above, it shows the error. How should I fix this?
Additional info: when the rows are shown using formula, there are no errors, but sadly, using formula is not an option and I need values as is.
You can type ="1-1" instead of just 1-1
When you type 1-1, excel change this to 1-Jan. When you type ="1-1" , Excel treat the value as string. Hope it helps.
Just right click on the column click on Format Cells ... on Number Tab on Category List select Text, this will make anything you enter or have as a text.
But if you are copy paste data then use Match Destination Format (M), just right click on the cell and select Match Destination Format (M) not Ctrl-V.
If you add a single quote to the start of the dates Excel treats it as a string. Works for numbers as text too
Stop excel from converting copy-pasted number/text values to date
Copy the original data
Paste to Notepad / Notepad++
In Excel, change the Format Cells / Number Format (that shows "General" as default) to TEXT
Copy your data from Notepad
Paste back to the Excel cells, in which you have changed the format to TEXT
Turn off error checks for those types of errors.
With Application.ErrorCheckingOptions
.TextDate = False
.NumberAsText = False
End With
Also found within File, Options, Formulas, Error checking rules.

How to convert Text to numbers in Excel 2010?

I want to convert the numbers from text format to numbers so tha i can make the average or sum of the whole columns.
I tried all the possible ways asfar as i read in many blogs, but nothing works.
There is no Green mark on the cell nor a quote '
Tried copying an empty cell and select required cells and paste special methods also.
It looks like you are using a French version of Excel. In this case a number should be 6,04 and not 6.04
Do a find and replace of . for , and you should be able to change the format to a number if it is not done automatically.
You can either:
change the values to numbers
use a formula that can handle text-type numeric values
Say we have data in column A that is Text. This formula:
=SUMPRODUCT(--(A:A))
can give you the sum without having to convert first:

How to add cells with mix of 6 to 8 decimal places together

Because of floating point values, I cannot add a string of cells that contain values such as:
0.08178502
0.09262585
0.13261762
0.13016377
0.12302067
0.1136332
0.12176183
0.11430552
0.09971409
0.125285
Even if I try adding the first two through a sum formula or auto sum through selecting them, excel spits out an error. I have googled this like crazy and tried to change number formats. Is there a function that can allow me to add this information ?
Screenshot:
The spreadsheet is available on my Dropbox.
Those numbers are all preceded by a NBSP (Char Code 160). So, in order to sum them, you have to remove that. Many solutions. Here's one:
=SUMPRODUCT(--SUBSTITUTE(A1:A18,CHAR(160),""))
If a formula like:
=A1+A2+A3+A4+A5+A6+A7+A8+A9+A10
produces:
#VALUE!
then your "numbers" cells contain non-visible characters.
They must be removed before the formula will work.
If the cells contain text strings and not actual values you will need to convert the text to numeric values before performing any calculations. The function "=value(cell)" will bring the numeric value.
e.g.: A1 contains "000.12345678" (or some other non-numeric presentation of numerals)
In cell B1 type: =value(a1)
Cell B1 now operates as the real number 0.12345678
Oddly enough, the fact that it said 0.xxxxx in all numbers vs. .xxxxx is what the issue was. I'm just sharing that for folks who google/search and have same issue.
All I had to do was select that whole row and do a search in replace for "0." and make it just "." and now my numbers were usable in equations. For some reason the adjustment of formating as many searches suggested wasn't working

Excel convert to h.mm format automatically

Is it possible to let Excel 2010 not automatically convert a text or number cell into h.mm format?
In other words I've 10 thousand cells that contain numbers and parenthesis like these ones:
1.2 (905.A)
1.3 (905.A1B)
etc. etc.
If I do find (*) and replace to nothing, Excel automatically convert these cells to h.mm format, also if I set these cells as "Text", so it display:
1.02
1.03
etc. etc.
instead I want:
1.2
1.3
etc. etc.
is there a way to do it?
Have you tried changing the column formats to text before pasting the values in?
If you are entering the values manually rather than pasting then prefixing the entry with a single quote will make Excel treat the field as literal text:
'1.2 (905.A)
UPDATE
After discussion I now understand that the problem occurs after the data in imported when you try to do a find and replace to get rid of the brackets and anything within them. I cannot replicate this issue, Excel seems to format the remaining number appropriately for me, but as you are still having this issue I would suggest an alternative approach to the find and replace:
If the text you quoted was in cell A1 then in B1 you could use:
=LEFT(A1,FIND(" ",A1)-1)
This will return everything before the space. You can then either just hide the column you don't need or copy the new values, right click and do paste special then select values to replace the formulas with their values and therefore remove the need for the old column.

Excel: Leading Zeros on Dates.. Formula to do it for me?

Is there a way to add a leading zero to a date that is 7 digits and should be 8?
7301982 should be 07301982.
I have a column full of these values, and need a way to do so with a formula. Any ideas?
I know this is an oldie, but when I googled for a solution this was the first result.
What I did was:
=concatenate(year(A1),text(month(A1),"00"),text(day(A1),"00"))
Where A1 is a date field.
=text(A1, "00000000") will do it.
Set a custom format of 00000000
Just another thought since this just happened on my new laptop. It could be your windows settings. If you prefer leading zeroes on the month everywhere in windows (like the lower right hand clock) then you can:
Control Panel >> Clock, etc >> Change Date, Time or Number Formats... then set the Short Date to MM/dd/yyyy.
This also carries over to Excel as the first date format. I know it is not a formula exactly as asked, but this is the article I found while searching.
Simply go to custom for the format of the number and select yyyy\m\d and add more m or d to it.
This is a good formula when you need leading zeros so another application sees a 9 digit number.
Add a column to your spreadsheet (Column B if your data is in Column A)
Use this formula in the new column: =REPT(0,9-LEN(A2))&A2&""
Get the 1st cell, then drag down as much as you need.
Remember to copy/paste option 123 to save as data. Otherwise, you'll see data but in reality it is a formula and you will receive reference errors if you try to use the data in column B.
9 digits and column B are variables. You can use any length or any column on your spreadsheet. Just adjust the formula.
Copied from another answer on a different site, worked for my like a charm!
ok. It seems that your dates are formatted as text. This is what you should do.
first, on a blank cell somewhere on the sheet, type the number 1. then, right click, copy.
next, highlight the entire column of dates. right click, paste special, multiply.
all of the dates will have turned into numbers.
next, highlight the date column, and apply the date format that you want.
There is a simple way to maintain the leading zeroes in Excel.
Simply add this to the cell and type whatever value you need and the zeroes will be retained
For ex: If I want 0000000023
Type into a cell '0000000023
That ' symbol seems to retain the zeroes as long as you type it before the values.
This date format MM/DD/YYYY is available if you select the Locale (location): English (Philippines). Try it with one cell and then copy/paste/special/formats the others.

Resources