how to do google finance 1 minute data bar? - google-sheets

Can you explain me how to do google finance 1 minute data bar ?
=GOOGLEFINANCE("TSLA", "ALL", HOUR("16:00:00"), HOUR("23:00:00"), MINUTE())
what i need to fix ?

there is no such thing. you can either have DAILY or WEEKLY

Related

Google Sheets OnEdit Split

I am trying to get the difference in hr/mins between the timestamp of the google form and 8:00 am. Currently, I am using the split function to break the timestamp up and then I am using the diff in time to calculate mins.
https://docs.google.com/spreadsheets/d/1WU_dDxRTX2JWqL1b3e8SHh0GMOfjZ9YT1LV7dADVmz8/edit?usp=sharing
Would anyone be able to make this occur onedit?
Thank you!
try in row 1:
={"Time Late"; INDEX(IFNA(TEXT(REGEXEXTRACT(TO_TEXT(Tardies!A2:A),
" (.*)")-VALUE("8:00"), "h:mm")))}

Is it possible to get Google Ads metric data on a daily basis within a date range?

I'm trying to display a bar chart that shows the performance of a Google ad between the 1st of March to the 31st of March. Each bar indicates a day in that range.
At the moment my query looks like
SELECT
ad_group_ad.ad.id,
ad_group_ad.ad.name,
metrics.average_cost
FROM
ad_group_ad
WHERE
segments.date
BETWEEN '2021-03-01' AND '2021-03-31' AND ad_group_ad.status = 'ENABLED'
The data I get back are totals within the range. I need the totals of each day within the range. Is there a way to get this information in one request?
I found a segment that segments the data into weekly slices.
SELECT
ad_group_ad.ad.id,
ad_group_ad.ad.name,
metrics.average_cost,
segments.week,
segments.keyword.info.text
FROM
ad_group_ad
WHERE
segments.date
BETWEEN '2021-03-01' AND '2021-03-31' AND ad_group_ad.status = 'ENABLED'
https://developers.google.com/google-ads/api/fields/v6/ad_group_ad#segments.week
segments.day is not documented but I can see on the google ads dashboard you can segment by days if the date range isn't greater than 16 days. I'm going to keep snooping around and see if I can find how that's done.
You just need to add segments.date to your select.

Google Sheets - Conditioning Formatting for Date Expiry

I have a spreadsheet with different dates for different clients where the contract expiry date turns red when it's due to expire in 60 days or overdue. The formula I am using is:
=AND((X:X>0), (X:X<60))
But it seems it's not looking at the year, so for example I have a date of 01/09/2021 which is red as the date has already passed (01/09), but it's showing red when it shouldn't because its 2021.
Any ideas? :) Thanks!!
try:
=(X:X>=1)*(X:X<=TODAY()+60)

How can I select the data between some specific hours in a specific month?

I already have InfluxDB working and getting monitoring data about some services (the value is just 1 for up and 0 for down). For the management I need to select the values from the database that are in a specific month and either night time or day time. For example: I want to select all the data from April 2019 (doesn't matter if it 1 or 0) between 08:00AM and 07:00PM (day time)
Here is what I've tried:
SELECT value FROM probe_success
WHERE "instance" = 'https://myservice/api' AND time >= '08:00:00' AND time < '19:00:00'
AND time >= '2019-04-01' AND time <= '2019-04-30'
But I've got an error:
{"results":[{"statement_id":0,"error":"invalid operation: time and
*influxql.StringLiteral are not compatible"}]}
Can anyone tell me what I'm doing wrong or point me in the right direction?
Thank you very much!
Ok, so after some research I've found that it is not possible to use the "OR" statement in a "WHERE" clause to specify multiple time ranges. See this. I solved this problem by sending separate requests for each day in a for loop and then concatenate all the results. It's not the best solution, I admit, but since they say it's not possible I guess this is the workaround.

Google Sheets, increment cell by month

I have a spreadsheet that keeps track of how old accounts are by months.
Is there a way to have Google Sheets auto update a cell on the 1st of each month?
VG: An account is 78 months old and on Sept 1st it turns 79 months. I want to automatically update it on the 1st of the month so I won't have to manually add 1 to every account age cell.
This is for Excel:
If the value is 78 on 25 August 2016 and you want the value to increment of the first of each month, then enter:
=78+MONTH(TODAY())-MONTH(DATEVALUE("8/25/2016"))+12*(YEAR(TODAY())-YEAR(DATEVALUE("8/25/2016")))
Assuming that your dataset does include an account start date in column A, you can calculate how many whole months are between that date and system date today by using:
=DATEDIF(A2,TODAY(),"M")
Tested this in Excel but should work in Google Sheets as well.
You could add another field, and do the calculation from the sheet:
[A1]=<start date>
[A2]=datedif(a1,today(),"M")
Otherwise, you could use a script to do this once a month, but you would need a list of cells somewhere that need to be updated. I would need to see an example of your spreadsheet layout to give you working code.
The process would be to:
set a daily trigger
check for the first of the month
if it is, go and update all the cells
if not, try again tomorrow
This worked out well for me in Google Sheets
DATEDIF("<MY_STARTING_DATE>", today(), "M")
example:
DATEDIF("8/1/2021", today(), "M")

Resources