Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
391 views
in Technique[技术] by (71.8m points)

Google tabs IMPORTRANGE with SUMIF problems

I know it has already been a few times discussed topic, but I haven't found any help that would suit my problem yet. I'm trying to make a sum of numbers in one column in a different Google sheet. The problem is I need to sum only those numbers happened in chosen month. I have the number of the month in the sheet where I need the function, and I have the month specifikation in a column next to the numbers.

All I came to till now is this (after many totally different codes):

=sum(query(IMPORTRANGE("xyz";"Vykaz!B23:C125");"select Col2,Col3 where "col2=G4";0)"))
  • G4 is the chosen month I have in the same sheet as this code

Please, could you help me figure this out? Thank you

question from:https://stackoverflow.com/questions/65843740/google-tabs-importrange-with-sumif-problems

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Google Sheet 1 (TabName = "externalTab")

Google Sheet 2 (TabName = "InternalTab")

Use importrange to pull the all data from "externalTab" to "Internal Tab". Then just use a sumifs formula to add up values based on your criteria.

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1sLPGZkAVlxWfjhDMU9oa_cww0AI570Rtem0XCoOx0AE", "'externalTab '!A1:AF2000")

Alternatively use the following formula. Integers to be summed are located in column a/Col1 and Months are located in column b/Col2. There is one header row on the spreadsheet and we are adding up all the Integers that correspond to the month June.

=sum(query(importrange("https://docs.google.com/spreadsheets/d/1sLPGZkAVlxWfjhDMU9oa_cww0AI570Rtem0XCoOx0AE","a1:b1000"),"select Col1, Col2 WHERE Col2 = 'June'",1))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...