Extracting substr and concat In Excel not working as it should - excel

So I have an excel file which has a date column in the format mm/dd/yyyy Like in this picture:
I want it in the format dd/mm/yyyy and i tried formatting the cells but they dont change. at last I chose to simply extract and concat the dates in a new column but it works for some cells while with others not.. this is the result:
As you can see sometimes it works and sometimes not. this is the formula I used (please bear in mind I am just starting out with excel and I have no clue of tricks or other methods) :
what is causing the faulty results in some of the cells ? TIA
Edit: Link for the data https://data.world/markbradbourne/rwfd-real-world-fake-data/workspace/file?filename=Call+Center.csv

If they are true date then can use-
=TEXT(A2,"dd/mm/yyyy")
If they are date format stored as text then can try-
=TEXT(DATEVALUE(A2),"dd/mm/yyyy")
If you need to extract strings then concat and convert to dates then try-
=DATE(RIGHT(A2,4),LEFT(A2,2),MID(A2,4,2))

You should use the DATE formula and then format as you need
=TEXT(DATE(RIGHT(E2,4),MID(E2,4,2),LEFT(E2,2)),"dd/MM/YYYY")
DATE formula takes Year, Month, Day as parameter - and converts that into a valid date.
TEXT then does the formatting for the output

Perhaps you should first try in using Text To Columns which in built in Excel, Under Data Tab, Grouped under Data Tools,
So just select those range, Goto Data Tab --> Click On Text To Columns --> Then select Delimited in the First Step --> Next --> Next as well in the Second Step --> and in the Third Step click on Date and change it to MDY and change the destination to adjacent cell and press Finish.
Since Dates & Times are stored as Numbers in Excel hence it will return you as numbers therefore you just need to format it as dd/mm/yyyy by pressing CTRL 1 --> Format Cells dialog opens --> under Number Tab --> Click on Custom and type by removing the General --> dd/mm/yyyy.
Using TEXTJOIN() & MID() Functions, assuming you are using either Excel 2019/2021 or MS365
• Formula used in cell B2
=TEXTJOIN("/",,MID(A2,{4,1,7},{2,2,4}))+0

Related

Excel convert dates from different formats

I have a data set with column A containing different date formats, the column format is date:
I would like to have all entries in the format dd-mm-yyyy, and one formula for the whole column.
With format cells, I could not get them into the same format.
I tried TEXT(A3, "dd-mm-yyyy"), but this does not do anything.
DATEVALUE(A3) gives me an error.
Is there a simple solution to this?
Given that Excel cannot parse the date before 01-01-1900 you'd need a proper date and then select your range, and go Data>Text to Columns.
Here, select Delimited and click Next. Deselect all options (usually only Tab is selected) and click Next. Select Date option and choose the format which seems to be DMY in your case.
Then you can use the formula such as:
=TEXT(A3,"dd-mm-yyyy")

How can I dynamically reference cells containing dates in cubemember formula

I have converted my Cube Pivot table to formulas using OLAP Tools > Convert to formulas.
The column labels are dates in UK format, which is fine. The CUBEMEMBER formula is as such:
=CUBEMEMBER("Name of Cube","[Date].[Display Date].&[27/01/2017]")
This is the issue:
If i copy and paste the date 27/01/2017 in this exact format (For example), and paste it above the cell that has the CUBEMEMBER formula, i can succesfully replace the member_expression part with that cell reference in 2 ways:
One: =CUBEMEMBER("Name of Cube","[Date].[Display Date].&["&B8&"]")
Two: =CUBEMEMBER("Name of Cube",B8)
I do not want to have to copy and paste dates, then link to those cells in order for it to work. I want to be able to link to a cell that already has a date in it. The difference is that its not in the EXACT same format as cubemember. Even if i copy the formats of the date, it does not work.
Any guidance??
Dates are stored as numbers in Excel. The way to get the date as you want it is by using TEXT. With Swedish number formats in Windows the date can be shown as text by using this formula:
=TEXT(A1;"ÅÅÅÅ-MM-dd")
the "ÅÅÅÅ" part should probably be "yyyy" or "YYYY" for UK formats and could of course be "dd/MM/yyyy".

excel date time cell being covertet to numeric and cant stop it

i have two sheets the first one to call a value from the second sheet, in the first sheet i have
=IFERROR(VLOOKUP(B2,'sheet'!B5:'sheet'!I2500,8,FALSE),"")
this works fine for all full text fields
but when i have a date time of
04/26/2013 11:27:00
it converts it to 41390.47708
if i manually edit the cell and put in an apostrophe it is fine but if i try and use a macro or another column to add the apostrophe it changes it to a number and then adds the apostrophe.
is there a way to get the formula to treat the cell as text
When you use a function like VLOOKUP it only retrieves the underlying value from the referenced cell, not the formatting (and display of date and time is achieved by formatting) - can't you just format the cell with the formula in the required format?
Right-click on the cell and choose Format Cells > Number > Custom and type this in the box
mm/dd/yyyy hh:mm:ss
If the formula might retrieve text or a date/time you can still format it that way because the text will be unaffected

how to format time from HH:MM:SS to HHMM in excel?

I have an excel sheet in which one of the column is transaction time and its format is HH:MM:SS. But I need transaction time in HHMM format so that i can upload that excel sheet into my application. As of now i am manually formatting each row, is there any way i can apply required format to whole column at once?
If for your eyes only:
select whole column, right click somewhere in your selection, go to Format Cells, tab Number, Catergory Custom.
Type HHmm
Press OK
done.
If you need this as the actual value:
make a column containing the following formula =TEXT(<targetcell>;"HHmm")
Note that it is language-dependant whether you need a , or ; in that formula.
You have two options:
Custom format the field.
Use a function in another cell. Suppose, cell A1 contains the text 15:48:58. You use the formula in another cell (say B1) as =TEXT(HOUR(A1),"00")&TEXT(MINUTE(A1),"00"). This gives the output as 1548.
For example, type .633 in B2 cell. When we convert 0.633 to time means we convert 0.633day. We consider 24 hours as 1 day.
Follow the steps:
Select B2 cell and right click.
From shortcut menu, go to Format cells. Format cells dialog box appears.
In the dialog box. click custom under Category list. Find hh:mm:ss from right list.
Now edit it as hhmmss in the right side just under 'Type:'.
You may read this tutorial from msofficeworld: Format Time in Excel

In excel: How to determine if 01/01/1900 then print out empty string, otherwise show the date

I'm trying to show all dates except for 01/01/1900. In excel, how do I first check for 01/01/1900 and then replace only that date with empty string or "", but leave any other dates alone? I also need to keep the format set to small date format of mm/dd/yyyy.
I tried to use replace, if, date, datevalue commands without successs.
Another answer which does not affect your data, but only the presentation layer is to set up a custom formatting. Choose the cells you want, and press CTRL+1 or choose Format Cells from the Format menu. Then under number format, Date should be selected. Click on Custom at the bottom of the list, then add two semicolons after the formatting string picture that is there.
A custom formatting string can have three (sometimes four) pictures seperated by semicolons. The first is for positive numbers, the second for negative, and the third for zero.
My formatting string looks like this: 'm/d/yyyy;;'. All zero dates (1/0/1900) will be blank. No extra column needed.
Create a new column next to your column with dates, and use this formula for every cell (A1 here refers to the source cell):
=IF(A1<>DATE(1900,1,1),A1,"")
Then format your new column as a date.

Resources