How to Importrange + Count on Google Sheets? - google-sheets

I'm trying to import data from another worksheet and count it simultaneously. It's only producing 1 for me, rather than 11 - which is what it should be.
I've tried the following:
=COUNT(IMPORTRANGE("URL","Shirts!F:F"))

first you need to run your importrange formula and allow access to link your sheets:
=IMPORTRANGE("URL", "Shirts!F1")
then try:
=COUNT(IMPORTRANGE("URL", "Shirts!F:F"))
also make sure your set is numeric

To count cell that not blank please use:
=COUNTA(IMPORTRANGE("URL","Shirts!F:F"))

Related

Importrange multiple files and query not pulling data

Im trying to import more than a 100 files into one masterfile.
The problem I'm having is that when I use query null to filter blank rows, some cells return as blank (probably because the entries to that cell's column may either be a text or number string)
Is there any way around this so that the query will just take the values/any string within the cell. I'd hate to see a lot of blank rows from the import of more than 100 files!
Appreciate any help. Thank you!
before using QUERY you can force the text format with TO_TEXT so:
=ARRAYFORMULA(QUERY(TO_TEXT({
IMPORTRANGE("id1"; "A1:A");
IMPORTRANGE("id2"; "A1:A");
IMPORTRANGE("id3"; "A1:A")}); "where Col1 is not null"; ))
keep in mind that every of your 100 importranges needs to be run as standalone fx prior to using the above formula to connect your sheets by allowing the access

Google sheets: How to use the CLEAN function on referencse from a different sheet

I have two sheets in my spreadsheet, I'm trying to get some columns from the first sheet into the second one and clean the data at the same time.
I've tried using:
ARRAYFORMULA(CLEAN({sheet1!A:A, sheet1!E:E}))
{ARRAYFORMULA(CLEAN(android!A:A)), android!E:E}
No error is shown, but the data is not cleaned, what am I doing wrong?
try:
=INDEX({CLEAN(android!A:A), CLEAN(android!E:E)})
or:
=INDEX(REGEXREPLACE({android!A:A, android!E:E}, "\s", ))
It seems that CLEAN formula together with arrayformula can work only with one column or row.
There are two ways to workaround.
First:
You can put these 2 columns one on another and use CLEAN formula and ARRAYFORMULA.
You should use a semicolon between ranges {sheet1!A:A ; sheet1!E:E}
The other method is to use all formulas twice in 2 columns
={ARRAYFORMULA(CLEAN(android!A:A)),ARRAYFORMULA(CLEAN(android!E:E))}

How to connect two google sheet workbooks using SUMIFS?

I have the following formula
SUMIFS(Sheet1!I2:I12,Sheet1!H2:H12,"1111-1111",Sheet1!B2:B12,"1111")
I want the Sheet1 from a separate workbook (not sheets in the same workbook), how can I do this?
My workbook1 is https://docs.google.com/spreadsheets/d/1L4t2xkmHPAOn8uGT3bFy56UMWrZaHsyq4FlOh6uR2g0/edit?usp=sharing
I want to do following in workbook2
= SUMIFS(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1VayuaMlSMvkhBKKuQnRTuTwk6kshFWQanWxa5KWh2ag","Sheet1!I2:I12"),IMPORTRANGE("https://docs.google.com/spreadsheets/d/1VayuaMlSMvkhBKKuQnRTuTwk6kshFWQanWxa5KWh2ag", "Sheet1!H2:H12"),"1111-1111",IMPORTRANGE("https://docs.google.com/spreadsheets/d/1VayuaMlSMvkhBKKuQnRTuTwk6kshFWQanWxa5KWh2ag", "Sheet1!B2:B12"),"1111")
use:
=QUERY(IMPORTRANGE("1L4t2xkmHPAOn8uGT3bFy56UMWrZaHsyq4FlOh6uR2g0", "Sheet1!A:I"),
"select sum(Col9)
where Col8 = '1111-1111'
and Col2 = 1111
label sum(Col9)''")
You can use the IMPORTRANGE formula to pull data from another sheet.
You can either embed the IMPORTRANGE in your formula in order to pull directly from it, or you can use the formula on its own in a new sheet, and pull from the sheet located within the same Spreadsheet for ease of access and a shorter formula overall.
Updating the spreadsheet you are pulling from will automatically update the data coming from the IMPORTRANGE formula.
For example:
A1 contains the basic formula =importrange("https://docs.google.com/spreadsheets/d/1I8BiB-2gSFueLIKiGsMY-URLOpnB8QzbUrx8/edit#gid=0", "Sheet1!I1:I12")
while B1 contains =sum(importrange("https://docs.google.com/spreadsheets/d/1I8BiB-2gSFueLIKiGsMY-URLOpnB8QzbUrx8/edit#gid=0", "Sheet1!I1:I12"))
Make sure you replace the URLs above with the one for the sheet you are trying to pull from
I think you need to use IMPORTRANGE to bring in the columns you want to your active sheet. You can either import the data first and then use a formula in another cell to work with it, or you can use IMPORTRANGE inside your SUMIF formula.
EDIT: Here's a workbook that has it working.
The formula in Sheet1!A1 is =IMPORTRANGE("https://docs.google.com/spreadsheets/d/1L4t2xkmHPAOn8uGT3bFy56UMWrZaHsyq4FlOh6uR2g0/edit?usp=sharing","Sheet1!A1:I12"), which pulls the data from your shared workbook1 into this sheet.
The formula in Sheet2!A2 is =SUMIFS(Sheet1!I2:I12,Sheet1!H2:H12,"1111-1111",Sheet1!B2:B12,"1111")
You could also put the SUMIFS formula on Sheet1 if you prefer. It's 2 steps instead of one, but it works!

Match + offset in google sheets

Probably quite simple, but cannot get it together.
I simply want to match cell B2 with the range D2:D12. If there is an exact match, then pull the link next to the table with destinations, and give that value in A1.
Thanks so much for the help!
// Non-coder building chatbot backend in Google Sheets :)
Try A1:
=VLOOKUP(B2,D1:E15,2,0)

external range in sumif formula in google spreadsheet

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.

Resources