SUMIF Help - Works and then dont - google-sheets

=SUMIFS(M10:M999; B10:B999; ">=1/1/22"; B10:B999; "<=31/12/22")
Above line is to sum up my result of M10:M999 in the date in B column is adressed to 2022.
But all in column M has this line of code;
=IFS(AND(L10="W"; D10="Long");(H10-G10)*F10; AND(L10="L"; D10="Long");(H10-G10)*F10; AND(L10="BE");"0"; AND(L10="W"; D10="Short");(G10-H10)*F10; AND(L10="L"; D10="Short");(G10-H10)*F10)
Which spits out either a positive or negative amount of DKK (or 0).
(https://i.stack.imgur.com/WJ0pM.png)
Image shows 2022 and 2023.
When swapping the date to 2023 in either row in the B column, 2022 row starts working again and the 2023 row stops working.
Can someone help me?
I hope the above image helps bring some clarity to my issue.
The "Gain" row on far right, is the one giving me a headache.
If I change the date on "#8" > It will show the answer in 2022 Gains but will give me the error in 2023.

** SOLVED **
My bad, I had an open order that wasn't showing a result cuz' the order in my sheet hadn't been close yet, now it works since the order has been closed and I filled in the missing part.

Related

Validation menu from column with dates where options are only the years

I need to create a data validation menu from a range like B:B where the entire column is populated with date and time every 2 hours. I need the menu to output as options only the years without repetition in this case only 2021 and 2022 but when dates from 2023 start being added automatically 2023 is added to the validation menu. Here is a dummy file to exemplify:
https://docs.google.com/spreadsheets/d/1ExXtmQ8nyuV1o_UtabVJ-TifIbORItFMWjtN6ZlruWc/edit?usp=sharing
Is such a thing possible?
use:
=UNIQUE(FILTER(YEAR(B:B), ISDATE_STRICT(B:B)))
This worked on A1 or wherever then point data validation to A:A or etc:
=SORT(UNIQUE(ARRAYFORMULA(IF(ISBLANK(B4:B),,YEAR(B4:B)))))

Match date in two cells with conditional formatting, +/- 3 days.. Google sheets

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)))

SUM gives me a date instead of a number in Google Sheets

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)

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 Spreadsheet conditional formatting based on another cell Date

I have a Google spreedsheet with multiple columns and I am trying to apply the following two tasks but can't seem to figure out how to do so.
I have two columns C and D, where C present a date picker and D present a drop down list with two values [Complete - In Progress]. I am trying to figure out a way where any cell in column D will display (In Progress) if the corresponding cell date is less than or equal todays date
If column C date is 2 days ahead, change the whole row color to blue
Can the above be done using Google d=Any thoughts how I can complete any of the above two tasks? Thanks in advance for your time and efforts
for example, if your Date is in C3 then like MKM said, the if function is your need
just paste this code into D3
=IF(C3<=TODAY();"in progress";"done")
i think that should do the trick, i tested your wish within this sheet:
https://docs.google.com/spreadsheets/d/1z6mwkxqc2NyLJsH16NFWyL01y0jGcKrNNtuYcJS5dNw/edit#gid=734876188
but i don't really get what you second question is about, hope this helps and answers this questions :)
PS.: may you can share your spreadsheet with us, so we might get a better understanding of your issue within google formatting ;)
I'm not sure on what your particular setup is, but I think using the IF statement may be what you're looking for.
For example:
C4 = Dec 10, 2017
D4 = Completed
D5 = In-Progress
E5 = IF(C4<[Specified Date], D5, D4)
Let's say [Specified Date] = Dec 8, 2017, then E5 would display In-Progress.
if the [Specified Date] = Dec 10, 2017 or higher E5 would display Completed.
For task 2:
You just need to add 2 Conditional Formatting for when cells are labelled as In-Progress and Completed.
I may have misunderstood your question as well.

Resources