I have this format in an excel column:
00:03:30
It represents 3 minutes and 30 seconds.
I need to convert it to a numerical format where I can add them.
Is there a special kind of format I can use?
If the format is text then you can't change that by changing the formatting
Check whether the data is text by using this formula applied to one of the cells
=ISNUMBER(A2)
That will presumably give you FALSE
Assuming there are no additional characters in your data you can convert with "text to columns" - just select column of "times" then use
Data > Text to Columns > Finish
Now you should be able to sum and/or re-format the data
Related
is there a way for me to make this
work?
the time is formated as TEXT
Create a new custom cell format. If you want to simply display the subtracted values as "0:00.500" (the value for the Column F cell outputting #VALUE), select General in the ribbon and then More Number Formats. Select the last option Custom to input the following in the Type field:
m:ss.000
This will allow for numerical values to calculate, so you can copy down your formula. If you want the cells to look exactly like the format you have in the last Column F rows (+0,000), use this custom type:
+_:s.000
(I am in the U.S., so I believe your cell will output with a comma in lieu of a period for the millisecond decimal point). FYI, cells with the regular Text format cannot be subtracted, added, etc. The format must be custom.
I have date column on two different sheets and when I run a match function (part of index match) it comes up N/A, because Excel says the two cells that have the same date in them are not equal to each other. When I change the format of one of the columns it changes to five numbers (which I know that is what excel uses to track dates), but the other column does not do this, it is simply text.
My question is, how to I get excel to forget about the five number date format and just give me text? Paste special values doesn't get it done like I thought it would.
I would say that you basically have two options: either convert both to text, or convert both to dates. If you want the text, the easiest way to convert them to text is via text to columns:
Select the column with the date (the one that turns to a 5 digit number when formatted to number or general) and select Text to Columns:
Click on next twice and select Text, then finish:
And that should do it.
I'll mention the other method, just in case, because in my experience, it's more often more practical to get the dates as actual dates in excel rather than text, especially when one wants to perform calculation on them or allow for different date formats.
The other method involves inserting 1 somewhere and copying it. Then select the set of dates that is plain text:
Use the paste special function and select 'Multiply' under the operations section:
All the dates normally should turn into those 5 digit numbers (if they were originally formatted as general for example). You simply then need to format them as date with the appropriate format, and your index/match should be fine matching the two date columns.
Excel will struggle to compare text (date as text) with numbers (date as an integer).
My suggestion is to convert the text into a 'proper' date. This is a good habit. When excel recognises something as a date it will store it as that 5-digit integer, but can display it however you choose (format cells to see the options)
So create a column next to your 'text dates'. Fill it with a formula which will create a 'proper' date, using the existing text.
If your text is in A1, then put this in B1. Assuming your data is dd/mm/yyyy
=date(right(a1,4),mid(a1,4,2),left(a1,2))
This is just saying that:
Year = rightmost 4 characters
Month= middle 2 digits (start at character 4 and grab 2 digits)
Day = leftmost 2 digits.
I assume you are using normal dates, and not the abomination that is USA format dates. But if your text is in USA data format then just swap the month and day parameters. Likewise if your text dates are 2 digits just tweak the 'year' parameter.
Check it works as expected, then copy down the column. You can now use column B for your vlookup or index match.
nb Jerry's answer is excellent and should work. I added the above because it tells you a little about how to directly work with dates. Good luck.
I have the same issue as this OP when trying to change the date format
Excel 2010 date formatting not working on some cells but on others
The solution does work on converting those 'Text' to date format. However for the other datas in the same column which are in 'Date' format they give a #VALUE! error as shown in the image below when the entire column uses the formula.
Is there anyway to resolve this issue other than manually keying in the date which does not need to be fix, as I'm afraid in the future I might have more than a few thousands date to manually change
The formula I've used is this which the entire column uses,
=DATE(RIGHT(A2,4),LEFT(A2,FIND("/", A2,2)-1),MID(A2,FIND("/",A2)+1,2))
The data in column A is a mixture of text that looks like dates, and real dates. All rows with the error have the dates as real dates and the left/right/mid functions don't work on the format but on the underlying value, which in the case of the dates is a number. Try it just =RIGHT(A4,4) to see what I mean.
In order to run the formula, all data needs to be text. You can quickly convert the data to text by selecting column A, then click Data > Text to columns > Next > Next > Select "Text" in step 3 and click Finish.
The data will be converted to text and all your error values will disappear.
As previously explained by one member of the community, I converted a text date format into a date format using "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
However, as you can see on the screenshot, some dates do not convert. I tried various things but do not find a reason. If anyone could help, it would be greatly helpful
The only way to replicate this seems to be formatting the cells appearance to dd.mm.yy. The fix being to change the cell format (visual mask) back to a standard date format. Text to columns does change the underlying data successfully.
Got it. Initially, my dates (text format) were MDY but I used DMY (in text to column)and it only worked for 60% of the dates. Then I used MDY (in text to column) and it works for 100% of the dates converted.
I have a csv that contains a list of dates, once imported into Excel they are in 2 different formats. How can I get them all in the same format?
Example:
01/23/2012
01/26/2012
40910
41031
You probably have a BIG issue with your file!
Probably, Excel is recognizing dates as "dd/mm/yyyy" but your data is "mm/dd/yyyy" formatted.
So, your numbers are really dates (just format, as #t.thielemans suggested). But are incorrectly parsed - month and day are switched!
Solution (assuming your dates are on A:A column):
To convert text to date:
=DATE(RIGHT(A1;4);LEFT(A1;2);MID(A1;4;2))
To correct day/month:
=DATE(YEAR(A1);DAY(A1);MONTH(A1))
Detect whether cell has date (dates are numbers, in Excel) or text:
=ISNUMBER(A1)
Finally, all combined within one formula:
=IF(ISNUMBER(A1);DATE(YEAR(A1);DAY(A1);MONTH(A1));DATE(RIGHT(A1;4);LEFT(A1;2);MID(A1;4;2)))
Just drag last formula from first row to end of your data and then format it as you wish (see #t.thielemans solution).
Select your data column and make sure they're highlighted. Go to Home>Number and select Custom and enter mm/dd/yyyy. You can also change the layout to one you want (mm-dd-yyyy/mmddyyyy/dd-mm-yyyy/...)