I have an excel file with 3000 rows. The value in A1 is 7/2-79 and in A2 7/2-80 and so on. When I tried to split these values using convert text to columns wizard, I get 7 in B1 and Feb-79 in C1 where I want 7 and 2-79 respectively.
I formatted the destination cells as text, but it not worked. Then I formatted the whole sheet as text, but no change in result.
Please help me.
Edit: While using Convert text to columns wizard, I tried changing column data format from "general" to "text" too.
I just tried it and you have to actually select the column with the 2-79 (step 3 of the wizard) and then fill the radio button that says text. If you only do it to the first column then you wont affect the one that's converting to a date.
Feb-79 is correct. Feb-79 = 2/79.
if you would like a string of text you can make
C1=Feb-79
D1=MONTH(C1)&"/"&RIGHT(YEAR(C1),2)
D1=2/29
or if you want to preserve the date value; right click on the range (cells or column) and Format Cells> Number tab > Custom category > Type: "m/yy" without ""
or you can do this
C1=Feb-79
D1=TEXT(C1,"m/yy")
D1=2/29
To get the same effect
Hope this helps.
Related
I have a cell which contains data like:
45677|abc|top|IG|pro|sjkdjs|cdf
and i want to extract each one of them into separate columns, is there an excel function that can do this or ill have to use pandas.
Use Data > Text to Columns and set the delimiter to |.
Select the cell or column that contains the text you want to split.
Select Data > Text to Columns.
In the Convert Text to Columns Wizard, select Delimited > Next.
Set the Delimiter to |.
You can see a preview of your data in the Data preview window.
Select Next.
Select the Destination in your worksheet which is where you want the
split data to appear.
Select Finish.
For one row you write how you want it to be.
just like given in above picture.
And then
Select the cell B1
Press CNTRL + E
Follow above 2 steps for each of cell i.e. C1,D1,E1,F1,G1 and H1 and you'll get all the automatically filled with delimiter. Result would be like below img:
I have an excel file which has data like "04 17" (right aligned) but the format is showing as DateTime i.e 4/1/2017.
My C# Production code is written in such a way that it recognizes if that is mentioned as text format (left aligned).
In the below screenshot all data in "Project Start Date" column need to be left aligned (like I manually wrote in 3rd line).
I am new to excel & macro, please give some clue how to convert these values. I have around 6000 lines, so cant re enter all the columns manually.
Set "Custom" format on column S, enter "MM YY" in the 'Type' slot (without the quotes) ... then set left alignment for the whole column from the menu.
If you need the text version, enter this formula in an adjacent column, let's say column T, row 6:
=TEXT(S6,"MM YY")
Extend the formula in the column to fill the 6000 row range. You can optionally lock in the text values by copying the column and then doing a 'Paste Special - Values' into a new column.
I have formatted a cell in Excel as Scientific with 1 decimal place then I inserted a number in it like (0.41). After pressing enter the result displayed is (4.1E-01). My aim is to put this result in a cell with text format so that when I double click the cell, I can copy/modify the text (4.1E-01) as I want.
I tried to format that cell as text but the result gets back to 0.41. I also tried to copy the cell and paste the value only using "Special Paste" into a text-formatted cell but the result keeps returning to 0.41. Do you have a suggestion on how to solve this issue?
Thanks in advance
This is a bit of a work around unless you want to use VBA. In an adjacent cell type this formula:
=TEXT(A1,"0.00E+00")
Now you can copy that cell and paste values only and get just the text:
2.22E+27
If your okay with VBA use this:
Range("A2").Value = Range("A1").Text
I have imported some dates into an excel document and I need to format them as dates not text strings.
The format is like this: 12.05.79 but when I set the format to date excel doesn't do anything.
Any way to do this?
C
Two possible ways to convert "in situ" without an extra column
1 - use "Text to columns"
Select column of dates then Data > text to columns > Next > Next > "under column data format" select "Date" and the format from dropdown (MDY or DMY) > OK
2 - use Edit/Replace. Replace "." with "/" (in both cases without quotes)
Changing the format doesn't change the value (or in this case text). You'll have to use a macro, or just use a helper column with the following formula. You can then copy / paste values and remove the first column
=DATEVALUE(SUBSTITUTE(A1,".","/"))
I have been searching for about an hour on how to do this in Excel.
I have an Excel file that was created from an old system and I am pulling information from a SQL Server Database, I will be inputting the information back into the SQL Server Database and would like the Dates to match.
I have tried Creating a Custom Format, but I am unsure if I even did it Correctly. I found several places where they want to go the other way mm/dd/yyyy to yyyymmdd but they have not been helpful.
I am unfamiliar with using VBA in any Microsoft Products otherwise I am sure that this would be a simple Task.
I have two separate columns that need to be changed.
How do I Format the entire column from (float)yyyymmdd to a (Date)mm/dd/yyyy
You can convert the value to a date using a formula like this, next to the cell:
=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))
Where A1 is the field you need to convert.
Alternatively, you could use this code in VBA:
Sub ConvertYYYYMMDDToDate()
Dim c As Range
For Each c In Selection.Cells
c.Value = DateSerial(Left(c.Value, 4), Mid(c.Value, 5, 2), Right(c.Value, 2))
'Following line added only to enforce the format.
c.NumberFormat = "mm/dd/yyyy"
Next
End Sub
Just highlight any cells you want fixed and run the code.
Note as RJohnson mentioned in the comments, this code will error if one of your selected cells is empty. You can add a condition on c.value to skip the update if it is blank.
Do you have ROWS of data (horizontal) as you stated or COLUMNS (vertical)?
If it's the latter you can use "Text to columns" functionality to convert a whole column "in situ" - to do that:
Select column > Data > Text to columns > Next > Next > Choose "Date" under "column data format" and "YMD" from dropdown > Finish
....otherwise you can convert with a formula by using
=TEXT(A1,"0000-00-00")+0
and format in required date format
Here is a bare bones version:
Let's say that you have a date in Cell A1 in the format you described. For example: 19760210.
Then this formula will give you the date you want:
=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)).
On my system (Excel 2010) it works with strings or floats.
for converting dd/mm/yyyy to mm/dd/yyyy
=DATE(RIGHT(a1,4),MID(a1,4,2),LEFT(a1,2))
Found another (manual) answer which worked well for me
Select the column.
Choose Data tab
Text to Columns - opens new box
(choose Delimited), Next
(uncheck all boxes, use "none" for text qualifier), Next
use the ymd option from the Date dropdown.
Click Finish