I've been trying to solve this issue for a few days now, but no matter what I try I can't seem to get it to work the way I want it to.
Firstly, to set a few paramaters that I've set myself since having everything neatly is a priority. I can't use helper columns, nor sheets and everything I use already is based on what is used. Secondly, the issue I have is that I can't drag specific data from one spreadsheet to another. (This work when it's dragging from one sheet to another, but not when it's two different spreadsheets.)
This is the formula I've been trying to make:
=ARRAYFORMULA(SUMIFS(
IMPORTRANGE("1JEYiK3etpIRSpd6BloVvwmGEhhi_5uAE_YBFmHPbLLg", "Event Logs!$I$8:$I"),
IMPORTRANGE("1JEYiK3etpIRSpd6BloVvwmGEhhi_5uAE_YBFmHPbLLg", "Event Logs!$G$8:$G"), "Patrol",
IMPORTRANGE("1JEYiK3etpIRSpd6BloVvwmGEhhi_5uAE_YBFmHPbLLg", "Event Logs!$K$8:$K"), $E$10:$E,
IMPORTRANGE("1JEYiK3etpIRSpd6BloVvwmGEhhi_5uAE_YBFmHPbLLg", "Event Logs!$F$8:$F"), "Contracted"
))
However it doesn't work, and I get the error that the "Arguement must be a range." In my previous system where I used something similar, it worked perfectly, however this was when both of the sheets were in the same spreadsheet.
=SUMIFS('Event Logs'!$E$3:$E, 'Event Logs'!$C$3:$C, "Patrol", 'Event Logs'!$G$3:$G, $A$5:$A, 'Event Logs'!$B$3:$B, "Contracted")
This screenshot is of the error that the formula with the IMPORTRANGE is creating.
This screenshot is of the data that the range "Event Logs!E7:K".
This is the older version where the simpler formula works.
And also the data from the previous version.
The last two screenshots are from the same spreadsheet, but different sheets, and the first two sceenshots, are two different spreadsheets.
If anyone can help, or guide me on how to make it properly please do and thank you for your time.
I've also tried different variations of this formula using the LET function to only drag the range once, however it doesn't seem to be working.
I've also resulted to using the help of ChatGPT and DeepSeek and even though they gave me results, it was mostly broken formulas that didn't work.
Try the following QUERY()
formula-
=MAP(TOCOL(A4:A,1),LAMBDA(dt,IFERROR(QUERY(IMPORTRANGE("1-M9uM4IxGWNOyRBiQfTDuMCyNoh9YGsiilWbyQPBTN0", "Event Logs!A2:G"),
"select sum(Col5) where Col2='Contracted' and Col3='Patrol' and Col7=date '" &TEXT(dt,"yyyy-mm-dd")& "' label sum(Col5) ''",0),0)))
See you spreadsheet, byharun24hr worksheet.