VLOOKUP and COUNTIF issue - how to combine them? - google-sheets

I am stuck on this formula and I need help.
I have a column with different values (names of websites) and I need a formula that will, firstly, count them all and show me the total number of sites (COUNTIF) and then I need all that to picked up by a VLOOKUP column so I can make an automated chart.
Here's what I have so far:
=COUNTIF(D2:D,"*",VLOOKUP(Y2,C2:D,2,FALSE))
The issue is that I don't know how to combine these properly and when I do it like this, I get: "Wrong number of arguments to COUNTIF. Expected 2 arguments, but received 3 arguments."
Any help would be appreciated!

Related

In array formula, find last specific value up till each row

I have a Google Sheets in question. Here is a mocked version that you can copy or comment on: https://docs.google.com/spreadsheets/d/1szcfZt_CtE0Cd_evKJwN4enZE7JcmDFcw9XhoX-_mlw/edit?usp=sharing
The sheets comes with 2 columns, Test number and Test result. I'd like to use array formula to automatically fill column C whenever new tests are entered. The specification is that the number in column C should always refer to the last "Fail" test number up till each row. You can see the expected result in column E.
I can come up with many solutions that require a formula to be applied to each new cell, which I think is iterative approach. One example is in column G. The reason is that "up till the current row" can't be met with array formula. I tried QUERY function with no success. I know App Script can do this too, but that's not auto fill approach as well.
EDIT: Added a brute-force solution, which can only work with limit number of consecutive "Pass" results.
Please see the screenshot for a solution using an array formula.

Google Spreadsheet: SUMIFS for same Column

I've got a problem in Google Spreadsheets:
I don't know why, but for Google there is a problem to use the SUMIFS formula.
When I try to use the SUMIFS formula for different criteria, for the same column, the output is always zero 0.
I tried aleady other things, but anyways it doesn't work.
Here are my examples:
Example 1
=SUMMIFS('Sheet1'!G1:G100;'Sheet1'!C1:C100;"Criteria1";'Sheet1!C1:C100;"Criteria2";'Sheet1'!D1:D100;"Criteria3")
Example 2
=SUMMIFS('Sheet1'!G1:G100;'Sheet1'!C1:C100;{"Criteria1" ;"Criteria2"};'Sheet1'!D1:D100;"Criteria3")
Example 3
=SUMMIFS('Sheet1'!G1:G100;'Sheet1'!C1:C100;"*Criteria1"&"Criteria2";Sheet1'!D1:D100;"Criteria3")
Non of these work. I dont know what I should do. Anyone has an idea?
Thanks in Advance
This behavior is probably correct. SUMIF criteria are connected AND not OR. This means all criteria need to be true.
So if you have two criteria on the same column it is very likely that only one of them can be true at the same time. Eg. column C can not be "Car" and "Book" at the same time. Therefore it is never count into the sum and always results 0.
To OR connect criteria have a look here: SUMIFS with OR.
this formula works:
=SUM(ARRAYFORMULA(SUMIF('Sheet1'!G1:G100;'Sheet1'!C1:C100 & 'Sheet1'!C1:C100 ;{"Criteria1";"Criteria2"} ; 'Sheet1'!D1:D100;"Criteria3")))
Anyways the bad thing is, that this formula cant disting date criterias.
Example1:
=SUMIFS(G2:G100;D2:D100;">=01.06.2011";F2:F100;"<=30.07.2011")
Does work, but this example 2 doesnt work:
Example 2:
=SUM(ARRAYFORMULA(SUMIF(D2:D100 & F2:F100;">=01.06.2011"&"<=30.07.2011";G2:G100)))
I Dont know why it doesnt work, has anybody a solution for this ?
Thanks in advance.

Google Sheets Error "Array Arguments to SUMIFS are of different size"

Converting from an Excel file (where this works fine), I have a SUMIFS formula that is returning an error "Array Arguments to SUMIFS are of different size". The formula in question looks like this:
=SUMIFS($G9:$EA9,$F$2:$DZ$2,">=1/1/"&A$2,$F$2:$DZ$2,"<=12/31/"&A$2)
The array arguments are:
G9:EA9 - 125 columns, 1 row
F2:DZ2 - 125 columns, 1 row
F2:DZ2 - 125 columns, 1 row
The criteria arguments are values. I'm not looking for a workaround or hack - just want to know if I'm somehow misusing the SUMIFS formula so I can maintain consistency with Excel
This turns out to be a quirk of Google Sheets, which only generates as many columns as "needed". So while Excel understands what EA means even when there's no content there, by default Google Sheets thinks there are far fewer columns, and therefore the offset array ranges were indeed different sizes. 38 vs 39 in my case. When I added 125 columns to the Sheet, the formula worked fine.
Quick Fix - Make sure the columns in your criterion range are un-merged, as soon as I made them single columns it worked.

Sum different unknown values from multiple tables in Google Spreadsheet

I'm having the following Issue and don't get the right formula. I don't even know, if it is possible.
I'm having three tables with different values. I want to calculate and sum up, which value appears how many times in all three tables. I don't really know the value when starting the process, so it should count the following: How often are which values shown in the tables.
Find a example of the problem here
so, the result should tell me, that overall, there are 3 values (a,b,c) and each value has a total quantity of 60.
Here, you'll find the result I'm looking for
I want to do that calculation with google spreadsheet, but I really don't get any solution.
Can somebody help? Thank you already in advance.
Try to use query function:
=QUERY({'Sheet1'!A1:B;'Sheet2'!A2:B;'Sheet3'!A2:B},"select Col2, sum(Col1) group by Col2")

SUMIF with FIND as criteria

I'm trying to summarize data from several Google spreadsheet' sheets in a single one but I have some issues with SUMIF and FIND.
To Sum data from another sheet I have to use this (at least that's the only solution I've found)
=SUM(INDIRECT(""&A6&""&"!E2:E"))
Where I have the name of my sheet on A6.This makes everything easy because I have a column (A) with all the names of the sheets. I haven't found something like Sheets[1] in Google Docs.
My next step was to Sum Times from a specific column but remove a specific values, which in this case is 1 that get transformed internally 24:00:00 since it's a time column:
=SUM(INDIRECT(""&A6&""&"!D2:D")) - SUMIF(INDIRECT(""&A6&""&"!D2:D");"24:00:00")
Here I tried to do everything with a single SUMIF but I have no idea how. NOT("24:00:00") didn't work so I settled to this.
The last part is the most difficult and I'm not able to solve it.
I have a column with month names (for example) and I want to sum some data only when the month name contains "er". Here is what I thought:
=SUMIF(A6:A16,ISNUMBER(Find("er")),G6:G16)
This gives me always 0
(Note that the last one contains A6:A16 instead of the whole INDIRECT part because I am still testing it in a single sheet.)
Any Idea what I'm doing wrong?
I don't know why the above SUMIF doesn't work, what I've tested and works is:
=SUMIF(A6:A16,"*er*",G6:G16)
SUMIF is NOT SUM + IF as I thought. I hope it will help someone else.

Resources