Concatenating Date and String in excel [duplicate] - excel

This question already has answers here:
Excel Date to String conversion
(10 answers)
Closed 9 years ago.
In Excel i am using following formula :-
="Select Count(1) Into Count1 From TRB_TPOAR Where tpo_id='" & A2 & "' and eta_id=old_eta_id and date_creation=to_date('" & B2 & "','dd/mm/yyyy HH24:MI:SS') and UTL1_EDS_ID='DEI037';
if Count1>0 then
Update TRB_TPOAR Set Eta_id=new_eta_id Where tpo_id='" & A2 & "' and eta_id=old_eta_id and date_creation=to_date('" & B2 & "','dd/mm/yyyy HH24:MI:SS') and UTL1_EDS_ID='DEI037';
DBMS_OUTPUT.PUT_LINE('" & A2 & "' UPDATED');
end if;"
In excel sheet Column B contains datetime information(eg 1/14/2013 12:20:01 PM), But when i apply the formula,it adds some other numeric value.Can anyone help me,what are the changes to make in above formula?

In your case, Excel returns the serila number of the date in referenced cell. To make sure it returns a string dispaying the date in the format you want, use =TEXT(cell, FormatString).
E.g.: TEXT(C2, "dd/mmm/yy")
Bonne chance

Related

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 put "/" on a date values?

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:

formula for difference between start & end time includes milliseconds in Excel

I want to find the time difference between start & end time using Excel
my Data :
A1 = 16:00:03:38
B2 = 16:14:13:58
which is in pattern of "h:mm:ss:ms" h=hours,mm=minutes,ss=seconds,ms=milliseconds.
am using like this =B2-A1 but it not giving result instead of it giving output like this " #VALUE! "
if i change like this
A1 = 16:00:03.38
B2 = 16:14:13.58
answer is = 00:14:10:20
the answer is giving perfect
but i don't want to change : to .
is it possible to take difference between two time's as per my requirements.
Let the formula do the conversion:
=TIMEVALUE(LEFT(B2,8) & "." & RIGHT(B2,2))-TIMEVALUE(LEFT(A1,8) & "." & RIGHT(A1,2))

Using tbl.Filter to filter between two dates

This question relates to the Schematiq add-in for Microsoft Excel.
I can use =tbl.Filter(table, "Date", ">" & date) to filter on one date but could you help me with a snippet to filter between two dates?
(Disclosure: I work on the Schematiq development team.)
You can use a snippet like this:
date => AND(date > *date1*, date < *date2*)
The full call would be:
=tbl.Filter(A1, "Date, "date => AND(date > *date1*, date < *date2*)")
If those dates are in (say) cells A2 and A3 then you would write:
=tbl.Filter(A1, "Date, "date => AND(date > " & A2 & ", date < " & A3 & ")")
Alternatively, you could use txt.Format to create the snippet:
=txt.Format("date => AND(date > {0}, date < {1})", A2:A3)

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