Filter sum with an OR statement? - if-statement

=SUM(H33:H41)+SUM(I33:I41)+ FILTER(Transactions!F:F,Transactions!C:C="Deposit")
The snippet above works fine, but I am getting errors when I try to add a filter for "Withdrawal".
=SUM(H33:H41)+SUM(I33:I41)+FILTER(Transactions!F:F,Transactions!C:C="Deposit")+FILTER(Transactions!F:F,Transactions!C:C="Withdrawal")

use:
=SUM(H33:I41)+FILTER(Transactions!F:F, REGEXMATCH(Transactions!C:C, "Deposit|Withdrawal"))

Related

Google Sheets WENN Date and Checkbox

i'm trying to figure out, how I can get my formula working.
It's telling me I need a valid date.
So if i'm going for this :
J3=checkbox, D5=date formated with =today(), G5=number between 1-30
=WENN(J3=FALSE;D5+G5)
This works fine ( today() + 1-30 )
Now here comes the error :
=WENN(J3=FALSE;D5+G5;);WENN(J3=TRUE;D5+7;)
This does not work because now it's telling me I need the valid date.
So my question is, how I can get it work?
try like this:
=IF(D3=FALSE; A3+C3; A3+7)
for arrayformula use:
=ARRAYFORMULA(IF(A3:A="";;IF(D3:D=FALSE; A3:A+C3:C; A3:A+7))

Is it possible to add an IF function within FILTER function?

I am trying to have a condition in a FILTER function to show based on an IF condition
If G1 is open or close, show 'All Jobs'!P2:P=G1 else If G1 is All then do not show condition.
Below is my attempt. But it is not showing any matches. I am guessing my formula is not correct.
=FILTER('All Jobs'!A2:P,'All Jobs'!B2:B>=B1,'All Jobs'!B2:B<=D1,'All Jobs'!G2:G=F1&
IF(((G1="Open")+(G1="Closed")),","&'All Jobs'!P2:P=G1,G1="All",""))
perhaps you can use:
REGEXMATCH('All Jobs'!G2:G, "Open|Closed")

Nesting IF and ISBLANK

Please help. I'm trying to get the cell to return blank but I'm having trouble.
=IF(AND($I2>1,AG2>=0.5),1,IF(AND($I2<1,AG2<0.5),1,IF(AG2=""),"",0))
There's and error message when I include the last argument IF(AG2=""),"",0.
This alternative hasn't worked either =IF(ISBLANK(AG2),"",IF(AND($I2>1,AG2>=0.5),1,IF(AND($I2<1,AG2<0.5),1,0)))
I've also tried with using IFERROR to return blank rather than DIV/O which ruins my pivot table. Thanks so much
Perhaps:
=IF(AND($I2>1,AG2>=0.5),1,IF(AND($I2<1,AG2<0.5),1,IF(AG2="","",0)))
Your error was parenthetical.

Google Sheets IF statement merged with concatenate

I am trying to get the following statement to work.
=IF(N3=100, (=concatenate("Text",A3;)), "Result").
Keep on coming with an error.
Any ideas please?
Do this instead:
=IF(N3=100, concatenate("Text",A3), "Result")
you can simply do it like:
=IF(N3=100, "Text "&A3), "Result")

Django Query in a loop fails for no good reason

I have this code:
msgs = int(post['time_in_weeks'])
for i in range(msgs):
tip_msg = Tip.objects.get(week_number=i)
it always results in an error saying that no values could be found.
week_number is an integer field. When I input the value of i directly,
the query works.
When i print out the value of i I get the expected values.
Any input at all would be seriously appreciated.
Thanks.
The range function will give you a zero based list of numbers up to and excluding msgs. I guess there is no Tip with week_number=0.
Also, to limit the number of queries you could do this:
for tip in Tip.objects.filter(week_number__lt=msgs):
#do something
or, if you want specific weeks:
weeks=(1,3,5)
for tip in Tip.objects.filter(week_number__in=weeks):
#do something