Google Sheet - Concatenate text with date format - google-sheets

How with Google Sheet I can concatenate text and date ?
This is what I have tried:
=CONCATENATE("Date : "; TEXT(C9, "YYYY-MM-DD"); ". Thanks.")
Output should be:
Date : 2023-01-03. Thanks.
Thanks.

You can get the value in cell C9 in the format it shows in the spreadsheet with the to_text() function, like this:
="Date: " & to_text(C9) & ". Thanks."

Related

Using Index Match with a Sum of a Range

Using Google Sheets:
Here is my current formula that I am using to return the data from ONE Date and I am looking to duplicate this formula except SUM the data of a Date Range.
Current Formula:
=IFERROR(INDEX('Delavan Ford'!$AJ$3:$AJ$1000, MATCH ($B$1,'Delavan Ford'!$V$3:$V$1000,0)),"")
B1= the current single date field that it is looking for a match for and returning the data.
I would be adding another field in B2 to be the second date that it is looking for to return the sum of the data between the 2 dates.
Thanks.
SumIF or SumIFs should work. Personally I prefer to use the QUERY() function as I feel it is more intuitive.
You can use SUMIFS() like-
=SUMIFS(A3:A,V3:V,">="&B1,V3:V,"<="&B2)
Or QUERY() function like-
=QUERY(A3:V,"select sum(A)
where V>= date '" & TEXT(B1,"yyyy-mm-dd") &
"' and V<= date '" & TEXT(B2,"yyyy-mm-dd") &
"' label sum(A) ''")

google sheet : function convert number (string) into money format

When i put number in a cell, i can use numbering/money format. For example :
123456 into 123,456.00
but this time , i need something like this but using function. Because the number will be add to a string. For example :
= "USD "& A1
if A1 contains 123456 then the output will be :
USD 123456
But i want the output to be formatted like this :
USD 123,456.00
Try
= "USD "& text(A1, "#000,000.00")
and see if that helps?

Check if a cell B contains all the words in a cell A with Google Sheets

I have a cell A2 that contains a string of text (eg: french cooking youtube channel). This is a dynamic cell as the input of this cell can change depending on the input of the user.
What I want to do is to check if the cell B2 contains all the words in A2. The order doesn't matter, what I want to see is if all of the words are present in the cell (eg: IF B2 contains youtube french channel cooking, it should be OK)
So far, I have tried the following formulas, but they're not working:
=IF(RegExMatch(A2;B2);"YES";"NO")
=IF(ISTEXT(REGEXEXTRACT(A2; B2)); "Yes";"No")
Is what I am trying to do even possible ? If yes, how could I go about it ?
Thanks in advance!
PS : here is a demo spreadsheet with the formulas I have tried so far: (https://docs.google.com/spreadsheets/d/1rEf_9rZSCf6RL9D44XN9Z7GGDwhQPxHdFDItXLgYh4M/edit?usp=sharing)
try:
=IFERROR(IF(FILTER(SPLIT(B2; " ");
NOT(COUNTIF(SPLIT(A2; " ");
SPLIT(B2; " "))))<>""; "no"); "yes")

Google Sheets Query: Bring data by date in cell

I am trying to query a google sheet by date. I have done some research and learned I need to convert to TEXT format so that I can run the comparison, but I am not able to get the syntax correctly:
=query('SheetName'!$A2:$S, "select A Where O=date'"&TEXT(B2,"yyyy-mm-dd")&)
Could you give me some guidance?
Some more info: in my query, B2 is a valid date in date format. Column O has some cells that are text strings and others that are valid dates; I have set the format of the entire column to "Date".
Here is a link to a simple example, feel free to play around with the query: https://docs.google.com/spreadsheets/d/1O4ms9ufvZ_CRLl_LG45hksjRoOJtv0XexbfjCLqFW4I/edit?usp=sharing
See if this works?
=filter('SheetName'!A3:A, 'SheetName'!O3:O=B2)
correct syntax should be:
=ARRAYFORMULA(QUERY(TO_TEXT(SheetName!$A2:$S),
"select Col16 where Col15 = '"&TO_TEXT(DATEVALUE(B2))&"'"))

Display text representation of a date as a formula result

I get this date format from Zapier
2018-08-16T01:13:58
I use this formula to split and extract the first half of the split (the date).
=index(SPLIT("2018-08-16T01:13:58","T"),0,1)
Google Sheets displays the formula output as a number, e.g. 43328
If I format this cell manually, using the menu Format >> Number >> Date, Google Sheets will display it as the formatted date, e.g. 16/08/2018
If I use DATEVALUE() as such:
=datevalue(index(SPLIT("2018-08-16T01:13:58","T"),0,1))
then the cell displays #VALUE!
Error DATEVALUE parameter '43328' cannot be parsed to date/time.
How can I write my formula such that it is displayed as formatted date, without having to format the formula's cell through the menu?
You can use the TEXT function:
=TEXT(43328,"dd-mm-yyyy")
Date shows in google spreadsheet are formatted by google spreadsheet settings. If you want to change the datetime format of your sheet, you will have to change Locale setting to that of your need.
If you don't want to go over settings, you can set it manually by code.
First, you will need to put this formula =SPLIT("2018-08-16T01:13:58","T") + "" somewhere to get the date value. Here I assume you use cell "Z1"
Now, you will have to change the date format each time "Z1" changes it value. I use onEdit(e)
function onEdit(e) {
var ss = SpreadsheetApp.getActiveSheet()
if (range.getColumn() == 26 && range.getRow() == 1) { // if Z1 is modified
var d = ss.getRange("Z1").getValue()
var inputDate = Utilities.formatDate(d, "GMT+7", "dd/MM/yyyy")
ss.getRange("B5").setValue(inputDate)
}
}
There you go. Each time Z1 change, which means the date value is inputted, the correct date + format will be reflected in B5.
After much searching this seems to work for me.
=regexreplace(SUBSTITUTE(SPLIT("2018-08-16T10:02:29","T") + "","-","/"), "^(\d+).(\d+).(\d+)$", "$3/$2/$1") & " " & regexreplace(RIGHT("2018-08-16T10:02:29", find("T","2018-08-16T10:02:29") -3), "^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$", "$1:$2:$3")
Outputs 16/08/2018 10:02:29

Resources