I am writing a few simple formulas for Google Sheets and I've been stuck on this for a little while now. I am trying to get a quick overlook of how many people got added to a sheet in the past week, counting from Saturday, but unfortunately, it's not working.
I have this piece of code to set the date since last Saturday.
=TODAY()-WEEKDAY(TODAY())
This works just fine. The output gives the date as 3/7/2020.
I then have a different row which checks if the recruitment date, which is stated somewhere differently, is bigger or equal to past Saturday. It checks it like this:
=IF(I2>=K2, "1", "0")
This gives an output of either 1 or 0 (1 if it was on Saturday or after Saturday, 0 if not).
Then I went to the main page, where I want to put the SUM. I put the following code:
=SUM('Control Center'!J2:J)
It should just add the 1's that are said earlier, but instead, it gives me the following date: 12/30/1899.
Does anybody know what went wrong? If you need any clarification, feel free to ask.
go to 123 menu and select Automatic or Number:
Take the quotation marks off the 1 and 0 so:
=IF(I2>=K2, 1, 0)
Related
I count the number of transactions made per month
=if(COUNTIF(ArrayFormula(month(
indirect($H$12&"!$F$3:F")
)),10)
=0,"",COUNTIF(ArrayFormula(month(
indirect($H$12&"!$F$3:F")
)),10)
)
Where 10 is October, while referencing a sheet named in $H$12. This works well for months 1-11.
When it comes to December, I am getting a seemingly random (wrong) integer back.
Is December somehow special?
I ended up using Filter. Seems to work perfectly fine
=COUNTA(filter(indirect($H$12&"!$A$3:A"),month(indirect($H$12&"!$F$3:F"))=10))
I am making a deadline sheet for office.
I have made a conditional format that compares the dates with our "office are closed"-dates provided by our HR-department. If the delivery date match any of the "office closed"-dates in the next column it will be coloured red.
This works fine, but I just noticed one thing. If the date where 1 day before the holidays, and the holidays would be many days a row starting next day, we wouldn't see that and we would probably get big trouble manage Finnish these masters before deadline as we are not at office for a few days.
So, I thought, maybe I could add to the script something that says: "compare the dates in this column with the dates in "Office Closed"-column, if there is a match within a range of 5 days, color it red...?
Is this something I can do?
here is a screenshot of the sheet.
This is the code I use in Conditional Formatting now:
=COUNTIF($L$4:$L$25,H6)>0 which works fine.
Thanks for any help!
/Andreas
Use following formula in CF:
=IF(LEN(A2),SUMPRODUCT((($C$2:$C+3)>=A2)*(($C$2:$C-3)<=A2)))
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.
I'm logging calls, emails and meetings using Google sheets. I am trying to get a chart of results based on a number of days in the past, 7, 30, last month, current month, etc. I am able to do exactly what I need to do using a fixed date but I can't figure out how to convert that to a date range.
Here is what is working:
={ARRAYFORMULA({UNIQUE(FILTER(CRM!M2:M2510,CRM!N2:N2510>=VALUE("2018-06-01 00:00:00"),CRM!N2:N2510<=VALUE("2018-08-01 23:59:59"),CRM!M2:M2510<>"")),ARRAYFORMULA(COUNTIF(FILTER(CRM!M2:M2510,CRM!N2:N2510>=VALUE("2018-06-01 00:00:00"),CRM!N2:N2510<=VALUE("2018-08-01 23:59:59")),SUBSTITUTE(SUBSTITUTE(UNIQUE(FILTER(CRM!M2:M2510,CRM!N2:N2510>=VALUE("2018-06-01 00:00:00"),CRM!N2:N2510<=VALUE("2018-08-01 23:59:59"),CRM!M2:M2510<>"")),"*","~*"),"?","~?")))})}
I need to change the value from a fixed date to a number of days in the past. What do I need to change in this formula? I tried using TODAY() -7 but I keep getting an error saying that I am missing brackets. When I use (TODAY()-7) I just get an #ERROR.
How can I change the VALUE("fixed date") to VALUE(TODAY -7)?
If your data looks like "2018-06-01 00:00:00".
Then use this conditions for filter to filter the last 7 days:
Arrayformula(datevalue(left(CRM!N2:N2510),10))>=datevalue(today()-7)
,
Arrayformula(datevalue(left(CRM!N2:N2510),10))<=datevalue(today())
I calculated a duration between two times, e.g. between 9:00 am and 11:00 am. So far so good. Now I need to decide if this duration is less 6 hours.
I do remember that this was pain in the s in excel but nevertheless I tried it the simple way:
=IF(E2 < 06:00:00; "y"; "n")
of course that didn't work. Next:
=IF(DURATION(E2) < DURATION(06:00:00); "y"; "n")
still, it didn't work.
So, okay, how can I compare two duration?
Divide hours by 24:
=IF(E2 < 6/24, "y", "n")
Value is E2 is a formatted time, actually 1 hour is 1/24, 1 day is 1.
Some info about date and time formats here:
http://www.excel-easy.com/examples/date-time-formats.html
You can also use the HOUR function if you want to
=if(HOUR(E2)<6,ʺyesʺ,ʺnoʺ)
or
=if(E2<time(6,0,0),ʺyesʺ,ʺnoʺ)
(if you write 06:00:00 in a formula it takes it as a string not a time)
but as I'm sure someone is about to point out, the first formula above gives the wrong answer for durations of more than a day (because it takes the hour part of a datetime).
What I find interesting is that you can assume for a worksheet formula that dates and times are represented as whole numbers (days) and fractions (parts of a day) just like in Excel. If you ever have to deal with them in Google App Scripts, you suddenly find that it's object-oriented and you have no choice but to use methods like hour() to manipulate them.
I needed to use the equivalent of:
=if(TIMEVALUE(E2)<6/24, "yes", "no")