in a google spreadsheet I want to use the formula SUMIF;
the syntax of function is SUMIF(A1:A10,"Paid",B1:B10)
as first parameter (and last) I want use a range of another google sheet;
I used the function IMPORTRANGE but the result is always #N/A
my code is:
sumif(importrange("xxhEwtMr2xxzRmiucxRgA5P119SEmsqL2R08gggt4Yyg", "list!$E:$E"),$S7,importrange("xxhEwtMr2xxzRmiucxRgA5P119SEmsqL2R08gggt4Yyg","list!$C:$C"))
where am I wrong?
ps.
the error pop-up report:
Error
Argument must be a range.
My understanding is that the third argument in the SUMIF must be a direct reference to the local worksheet.
You can either add an additional tab to import the data into, or try a different formula approach such as:
=SUM(QUERY(importrange("xxhEwtMr2xxzRmiucxRgA5P119SEmsqL2R08gggt4Yyg", "list!$C:$E"),"select Col1 where Col3 = '"&$S7&"'",0))
You could make an easier work around is to use the import range to a new sheet.
Then sumif it from that sheet. It will still dynamically update.
Related
I recently noticed a mistake in my calculation, and I've identified the root cause of the problem: it seems that I mistakenly used the SUMIF function in Google Sheets' ARRAYFORMULA.
I have the sample spreadsheet here.
I wrote the ARRAYFORMULA function that results in column C, which I thought would be the same with the formula in column B.
The formula in column C:
=ARRAYFORMULA(SUMIF(H$3:H$6&I$3:I$6,"<="&A3:A31&">="&A3:A31,G$3:G$6))
The formula in column B:
=SUMIFS(G$3:G$6,H$3:H$6,"<="&A3,I$3:I$6,">="&A3)
In essence, I want to get the value for each date based on predefined values with their own periods.
Please, use this formula in the cell C3:
=ARRAYFORMULA(MMULT(IF((A3:A31>=TRANSPOSE(H3:H5))*
(A3:A31<=TRANSPOSE(I3:I5))=1,TRANSPOSE(G3:G5),0),ROW(G3:G5)^0))
I made a new tab called MK.Help and erased all the other formulas. then i put this formula in C3:
=ARRAYFORMULA(ARRAY_CONSTRAIN(MMULT(N(A3:A>=TRANSPOSE(A3:A)),MMULT((A3:A>=TRANSPOSE(H3:H))*(A3:A<=TRANSPOSE(I3:I)),N(G3:G))),COUNTA(A3:A),1))
Does that work for you?
I am encountering a capacity issue with one of my spreadsheets but certain information in the sheet still needs to be available to cross-reference. The original spreadsheet contains this formula:
=sumif(A:A,A2,N:N)=O2
I tried to do a direct transfer to the new spreadsheet by adding importranges like this:
=SUMIF(IMPORTRANGE("URL","Sheet1!A2:A"),IMPORTRANGE("URL","Sheet1!A2"),IMPORTRANGE("URL","Sheet1!N2:N")=IMPORTRANGE("URL","Sheet1!O2")
The equation keeps putting out an error saying "argument must be a range". Then I tried to write it out as a query like this:
=QUERY(AND(IMPORTRANGE("URL","Sheet1!A:A"),IMPORTRANGE("URL","Sheet1!N:N"),"SELECT SUM(CASE WHEN Col1=A2 THEN Col14)=O2"))
But the equation is showing FALSE as the result when it should say TRUE. I have attached an example spreadsheet so that these equations make more sense.
I also need the equation to take into account any new information that is placed on the new spreadsheet while also comparing it with the old info. I tried doing this to start with but then slowly realized the initial equation itself doesn't work.
=SUMIF(IMPORTRANGE("URL","Sheet1!A2:A"),IMPORTRANGE("URL","Sheet1!A2"),IMPORTRANGE("URL","Sheet1!N2:N"))=IMPORTRANGE("URL","Sheet1!O2")+SUMIF(A:A,A2,N:N)=O2
Any help is appreciated.
https://docs.google.com/spreadsheets/d/1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo/edit#gid=0
use this formula instead of SUMIF:
=ARRAYFORMULA(IF(LEN(
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!C2:C")),
IF(IFERROR(VLOOKUP(
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!C2:C"),
QUERY(IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!A2:N"),
"select Col3,sum(Col14) where Col1 is not null group by Col3 label sum(Col14)''"),2,0))=
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!O2:O"), TRUE, FALSE),))
I have the following problem. I'm trying to write query formula in order to put all values in one sheet by typing yes in one column, however, I have the following problem. Whenever I add a new column, references in query formula (multiple sheets) are changing and the formula doesn't work. How can I prevent this?
Or is there any way to query by a column name in multiple sheets?
I have tried locking relative references by putting sign $
I have tried to use an indirect formula to take references (data set in Helper TAB, cell E2) - nothing worked
I'm out of the ideas, for now, anyone knows how to fix this?
=QUERY({'Sheet 1'!$A:$Z;'Sheet 2'!$A:$Z;'Sheet 3'!$A:$Z;'Sheet 4'!$A:$Z}, "select * where Col1 ='yes'",0)
Here is the file I did, you can see query formula in Master sheet:
https://docs.google.com/spreadsheets/d/1XD-CECy5W5-HM5EkBFJQKDtLlykQq8Cj8ZOvDUXkd1s/edit?usp=sharing
A solution to the problem is to use a formula that searches for the column address based on a reference.
=SUBSTITUTE(ADDRESS(1;COLUMN(A1);4);"1";"")
This formula will return the value A, which is the column of address A1.
It can be used in query functions like this:
=QUERY(A:D;"SELECT "&SUBSTITUTE(ADDRESS(1;COLUMN(A1);4);"1";"")&"")
This function is equivalent to the function:
=QUERY(A:D;"SELECT A")
This formula works in my original google sheet, but I want to move this to a new workbook to import from the original.
=SUMPRODUCT((($O10<='Daily Receiving'!$D$1:$CO$1)*($A$2>='Daily Receiving'!$D$1:$CO$1))*('Daily Receiving'!$A$3:$A$1306=$A10)*'Daily Receiving'!$D$3:$CO$1306)
Here is one version I have tried and I get an error that says array arguments to multiply are of different size.
=SUMPRODUCT((($O10<=(IMPORTRANGE("httpspreadsheet","Daily Receiving!$D$1:$CO$1"))*($A$2>=(IMPORTRANGE("httpspreadsheet","Daily Receiving!$D$1:$CO$1")))*((IMPORTRANGE("httpspreadsheet","Daily Receiving!$a$3:$a$1306")=$A10)*(IMPORTRANGE("httpspreadsheet","Daily Receiving!$d$3:$cd$1306"))))))
=SUMPRODUCT(((IMPORTRANGE("httpspreadsheets","Daily Receiving!$D$1:$CO$1")<=$A$2)*(IMPORTRANGE("httpspreadsheets","Daily Receiving!$D$1:$CO$1")>=$O10))*(IMPORTRANGE("httpspreadsheets","Daily Receiving!$a$3:$a$1306")=$A10)*(IMPORTRANGE("httpspreadsheets","Daily Receiving!$D$3:$CO$1306")))
I know how sumif works when I need to access it within the same Google "workbook" (using the analogy from excel). By workbook I mean a collection of sheets, not sure whether there is a different way to refer to Google workbook.
For example in the sheet (Example 3): https://docs.google.com/spreadsheets/d/1Dm-N-1X38zHartE3JbPUtWDnYwEpkGHl6v06huvjSa8/edit#gid=0
I have Sheet2, with column A contain strings and column B containing numerical value. On sheet 1, I have a sumif function which can be query data stored in Sheet2, and sum the cells which match A1 in Sheet1.
The problem starts happening when I try to refer to ranges in a completely different workbook, which is shown below.
I am trying to do a sumif over 2 ranges from a different "workbook". The data is stored here (Example 2): https://docs.google.com/spreadsheets/d/1P5Inf09fLSRmsGbG7LwlE4V-r7DzqY0SB5tJuMKMZH0/edit#gid=0
The Sumif function is in Cell B1 of the following sheet (Example 1):https://docs.google.com/spreadsheets/d/1AitilELd6w7Dbv9d-mKhBYGTBaO6DdkU29Y5mofX2TI/edit#gid=0.
From my understanding importrange is typically used to refer to ranges in completely different workbooks, as a result I use importrange as the first and last arguments in the sumif function in the Sheet Example 1.
What am I doing wrong? Why is this not working?
Can anybody help?
Thanks a lot
See if this query does what you want:
=SUM(query( QUERY( Importrange("1P5Inf09fLSRmsGbG7LwlE4V-r7DzqY0SB5tJuMKMZH0","Sheet1!A1:B10") ) , "select Col2 where Col1 contains '"&A1&"'" ) )