How to put "/" on a date values? - excel

what excel formula should I use to change a date value that is numbered into a date format. For example
5312018 into 5/31/2018
or 10202018 into 10/20/2018
See also image example below.

You could try:
=IF(LEN(A2)=8,LEFT(A2,2),LEFT(A2,1)) & "/" & IF(LEN(A2)=8,MID(A2,3,2),MID(A2,2,2)) & "/" & RIGHT(A2,4)
Results:

Related

Add Cell value into URL to find Data vba

I am trying to replace 558899 this Id number from below URL with cell value that is ID_NO = ws.Range("A1").Value.
"15.156.352.352/api/Book/GetOrBookID?Id=558899&ColumnName=PrimaryId"
and i changed it to
"15.156.352.352/api/Book/GetOrBookID?Id=" & ID_NO & "ColumnName=PrimaryId"
But it does not work nay help will be appreciated.
Your question doesn't mention what the bad result is, but I can see one issue in your code:
"15.156.352.352/api/Book/GetOrBookID?Id=" & ID_NO & "ColumnName=PrimaryId"
When this is parsed, it will result in:
"15.156.352.352/api/Book/GetOrBookID?Id=xxxxColumnName=PrimaryId"
But I think you want:
"15.156.352.352/api/Book/GetOrBookID?Id=xxxx&ColumnName=PrimaryId"
So the code you need is:
"15.156.352.352/api/Book/GetOrBookID?Id=" & ID_NO & "&ColumnName=PrimaryId"
Im guessing that the cell value is formatted as a number(long). therefore you could try replacing ID_NO with str(ID_NO) to convert it to a string

Convert 5 cells with 1s and 0s into a single array like {1,0,0,1,1} in Excel

Alright, in excel I'm converting a 5 bit binary code into a single array in the form of a string. Cells D62, D64, D68, D70, and D72 all have either a 1 or a 0, and I'm requesting help to convert these cells with numbers in them into an array by using a formula. I need the output to cell D59.
=IF(ARRAY(D62:D70)={1,1,1,0,0},1,0)
something like that
To change the 5 cells values to a 5 bit binary letter just concatenate:
=CHAR(BIN2DEC(A1&A2&A3&A4&A5)+64)
If one has CONCAT:
=CHAR(BIN2DEC(CONCAT(A1:A5))+64)
In D59 enter:
="{" & D62 & "," & D64 & "," & D68 & "," & D70 & "," & D72 & "}"

How to make an english date format work in a french Excel?

I have an Excel file that must work for english & french computer.
I need to concatenate dates in the format yyyy-mm-dd, so for my english user, I need to do:
="your date = "&TEXT(A1,"yyyy-mm-dd")
That works, but not in french Excel, where I need to do
="your date = "&TEXT(A1,"aaaa-mm-jj")
How can I print the same date to both my users, independently of theirs Excel langage locale?
English TEXT function vs French TEXTE function.
And yes, the date format string are localized...
To get the date in right format use:
=YEAR(A1) & "-" & RIGHT("0" & MONTH(A1),2) & "-" & RIGHT("0" & DAY(A1),2)
I found this link which seems to treat your issue :
If you are using the TEXT worksheet function because it is part of a larger formula, then you can instruct the function itself to use a different language for its output. You do this by including a language code (formally called an LCID) within brackets, in this manner:
=TEXT(A1,"[$-409]mmmm, yyyy")
Where you could specify the text to display according to the language you want.
I used to cope with this issue as follow assuming you're on a eng MSExcel:
1. I create a named formula (returns true when it's a fr region MSExcel)
name: xlFR
refers to: = text(Today(),"d") = "d"
click OK
2. in your formula you decide on xlFR
ex: = Text(today(), if(xlFR,"jj-mm-aaaa","dd-mm-yyyy") )
That's it.
Hope this helps.
I use this vba function in my formulas:
Function DateToText(MyDate As Date)
DateToText = Format(MyDate, "DD/MM/YYYY")
End Function

Trying to set a date field to barcode

So I am attempting to add a barcode on a spreadsheet that i am using. the problem is when i try and convert the date field, it comes out as a excel datetime type.
="*"&A5&"*"
A5 is my date field, and this is what the barcode looks like before i switch it to the font.
*40763*
does anyone have any ideas on how i can make that so I can barcode the date field?
I'm using Excel 2010
For day/month/year:
="*" & DAY(A5) & "/" & MONTH(A5) & "/" & YEAR(A5) & "*"

How to convert date to week number

How can I convert 20110114 (YYYYMMDD) to week, eg WK02-11, in excel ?
Thanks.
First convert the number in a date. Supposing your number is in A1 cell
=DATE(LEFT(A1;4); MID(A1;5;2); RIGHT(A1;2)
Then use WEEKNUM
=WEEKNUM(DATE(LEFT(A1;4); MID(A1;5;2); RIGHT(A1;2), 2)
(gives 3)
Then, if you want, you could embellish the result:
="WEEK-" & WEEKNUM(DATE(LEFT(A1;2); MID(A1;5;2); RIGHT(A1;2), 2) & "-" & LEFT(A1;4)

Resources