Google Sheet SUMIFS formula returning 0? - google-sheets

I have a SUMIFS formula in Google Sheets which is the following:
=SUMIFS('AWIN MASTER'!$AW:$AW,'AWIN MASTER'!$AT:$AT,">=" &A101,'AWIN MASTER'!$AT:$AT,"<" &A102)
This formula is the sum of a cost on another sheet, when the date is between two dates on the current sheet.
which is returning 0 when it shouldn't... it's working for my other formula but not mine... Could someone help please?

try:
=SUM(IFERROR(FILTER('AWIN MASTER'!AW:AW;
'AWIN MASTER'!AT:AT >= A101;
'AWIN MASTER'!AT:AT < A102)))
or see if you got the right conditions:
=FILTER('AWIN MASTER'!AW:AW;
'AWIN MASTER'!AT:AT >= A101;
'AWIN MASTER'!AT:AT < A102)

I found that it was because of formatting through IMPORTRANGE
Thank you all for your help!

Related

ARRAYFORMULA FILTER VLOOKUP solution for multiple condition formula Google sheets

I need an ARRAYFORMULA, VLOOKUP or FILTER formula in K7 that:
Puts the date from A7:A IF the value in J7:J is >= E7:E AND <= F7:F AND D7:D = "Traverse"
I have got multiple solutions to work on the individual rows, but none to work as an array formula to effect the entire column.
=IF(AND(J7>=E7:E,J7<=F7:F,D7:D="Traverse"),OFFSET(J7,0,-9),"")
or
=IFERROR(FILTER(A:A,E:E<=J7,F:F>=J7,D:D="Traverse"))
or
=ArrayFormula(IFNA(vlookup(J7:J2064,Query(sort(filter({date("20"&left(A7:A,2),mid(A7:A,3,2),right(A7:A,2)),A7:G},D7:D="Traverse"),6,1,1,0),"Select Col6,Col2",0),2,1)))
an example sheet is here if anyone can shed any light :)
https://docs.google.com/spreadsheets/d/1SYbhfyIA2KoZF0k-TuIqm-Kn9L9o0I16EGbSXDaTABU/edit?usp=sharing
use:
=ARRAYFORMULA(IF((J7:J>=E7:E)*(J7:J<=F7:F)*(D7:D="Traverse"), A7:A, ))
update:
=ARRAYFORMULA(IFNA(VLOOKUP(J7:J, SORT({
FILTER({E7:E, A7:A}, D7:D="Traverse");
FILTER({F7:F+1,H7:H}, D7:D="Traverse")}), 2, 1)))
Thanks for your help, in the end I managed to get a formula working from someone on the Google help forum. This is a working solution if you're interested:
=ArrayFormula(IFNA(vlookup(J7:J,sort({filter({Register!E7:F,Register!A7:A},Register!D7:D="Traverse")
;if({index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2);""}
>{"";index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,3)},
{{"";index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,3)}+1,
{index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2);""},
iferror({index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2)
;""}/0,"")},)},1,1),3,1)))

How to calculate months with arrayformula in google script

I am able to calculate the monthly difference using dateif but not arrayformula
Example : Start Date: 5-Oct-2020
End date: 9-Jun-2021 month difference: using formula (DATEDIF(D3,E3 , "M")).
But I'm unable to use array formula to calculate as I wanted each row to be auto-calculated with dates.
Appreciate some help from Google experts!
Try
=ArrayFormula(IF(LEN(D3:D), DATEDIF(D3:D,E3:E, "M"),))
and see if that works?
References
Arrayformula()
How do arrayformulas work?

How can I count with two criteria in google spreadsheet?

I am quite confused on how this function...
I am trying to count date and activity but inorder to count activity, it should be not blank and it follows the corresponding date. How can I code it? Tried countifs but I can't make it work.
Thanks in advance
https://docs.google.com/spreadsheets/d/1XfAp1RKp55jDRj7jSTIPGQSvy1GHH8KE-VR-vJmCF3w/edit?usp=drivesdk
your formula should be:
=COUNTIFS(A$2:A, D2, B$2:B, "<>")

Use SUMIFS in an ArrayFormula Google Sheets

I've already seen a lot of topics about my problem, but I can't resolve it.
Actually, I don't understand what is wrong in my formula ?
=ArrayFormula(
IF(
ISBLANK(A6:A);;SUMIFS(
Sheet1!J:J;
Sheet1!K:K; ">="&A6:A;
Sheet1!K:K;"<="& EOMONTH(A6:A;0)
)
)
)
What I'm trying to do :
Each line is a month. I want to SUM all sales made between the first day on the month, and the last one.
If I don't use ArrayFormula, it works. I dont understand how to write this formula to work with ArrayFormula.
Thank you very much for your help !
Just adding this as an answer for you,
Instead of using an array formula, I believe a query would serve you better.
as google date-time syntax is tricky we first have to convert the date value into a text and parse it as "yyyy-mm-dd" we then wrap the EOMONTH to get the last day of the month.
so we use the following formula to get the sum of the months sales:
=query(A:B;"Select sum(B)
where A <= date '"&text(eomonth(E14;0);"yyyy-mm-dd")&"'
AND A >= date '"&text(E14;"yyyy-mm-dd")&"' label sum(B) '' ";0)
hopefully, this is what you were after, apologies for the delay was on the train!
https://docs.google.com/spreadsheets/d/1ygppZZCd4b_Y_HufLwLdcynHAsa3pn6z5YXb3Poc3vk/edit?usp=sharing

Conditional formula in Google Spreadsheet

I'm trying to set up the following formula:
I have an Overview sheet where I want to sum the fields in Column B in Sheet named "Accounting", BUT, only sum the Expenses where Column D of the same row in Sheet Accounting is "Expenses"
I've tried a few different formulas, and none worked. Here's the latest one I tried
=search("Expense",(Accounting!B:B)) SUM(Accounting!B:B)
Can anyone help me?
Thanks!
=SUMIF(Accounting!D:D,"Expenses",Accounting!B:B)

Resources