VLOOKUP evaluates to an out of bounds range - google-sheets

Why do I get this error for the following formula?
=ARRAYFORMULA(VLOOKUP(Q8:Q1000&" "&"You",{A8:A1000&" "&B8:B1000,C8:C1000},3,false))
I have tried this as well
=ARRAYFORMULA(VLOOKUP(Q8:Q&" "&"You",{A8:A&" "&B8:B,C8:C},3,false))

{A8:A1000&" "&B8:B1000, C8:C1000} is wide only two columns, therefore use:
=ARRAYFORMULA(IFNA(VLOOKUP(Q8:Q&" "&"You", {A8:A&" "&B8:B, C8:C}, 2, 0)))

Related

Using COUNTIF with the Array Formula

I'm trying to get a simple COUNTIF formula to combine with the Array Formula in order to count the number of zeros in each row. The original basic formula would look like this:
=COUNTIF($C6:$CD6,"0")
I would want the formula to go down so that it counts the number of zeros in each row.
Please could someone tell me which formula to use? I've tried countless versions with Arrayformula and none of them are working the way I want them to.
Thank you.
EDIT/ADDITION: I've used the formula below to count the zeros in a row.
=ArrayFormula(IF(ISBLANK($A6:$A),,INDEX(MMULT(1*(IF($CH6:$DA="", "×", $CH6:$DA)=0), SEQUENCE(COLUMNS($CH6:$DA), 1, 1, )))))
I have used another formula (below) to sum the amounts in certain columns (which are categorised).
=ArrayFormula(IF(ISBLANK($A5:$A),,SUMIF(IF(($C$2:$CD$2)="Alphabet",ROW($C$5:$C)),ROW($C5:$CD),$C5:$CD)))
In addition to this, I've realised it would be helpful to be able to count the zeros in those same columns. That means I would kind of combine the two formulas above.
Is there a way to do this, please?
try:
=INDEX(MMULT(1*(IF(A1:D4="", "×", A1:D4)=0), SEQUENCE(COLUMNS(A1:D1), 1, 1, )))

how to fix Lookup function error #N/A on google sheet

I have an issue error #N/A Message with VLOOKUP and LOOKUP function, as it is shown on the image I can't find out where is the error, can you help me guys
The value you look up must be found in the first column of the vlookup range.
You can try reordering the columns in an virtual array. For the highlighted cell (in the image you shared) that would make the formula:
=VLOOKUP("5f8961ec", {$K$2:$K$26, $J$2:$J$26}, 2, false)
Of course, you can also replace the value '5f8961ec' with a cell reference.
use in E1 after you delete everything in it:
=INDEX(IFNA(VLOOKUP(A1:A, {K2:K, J2:J}, 2, )))

How to put 2 formulas instead of range

I have a complex sheet working with the Filter formula, and I want to do the following:
=arrayformula(Roster!A3:A)
=FILTER(Roster!G3:BZ,Roster!G2:BZ2=U6)
now I want to do vlookup for using the above 2 formulas as following:
=VLOOKUP($T$7:$T$110,**$X$7**:**$Y$830**,2,0)
The range $X7 = =arrayformula(Roster!A3:A)
The range $Y$830 = =FILTER(Roster!G3:BZ,Roster!G2:BZ2=U6)
How i can compound the 2 formulas?
use:
=ARRAYFORMULA(IFNA(VLOOKUP(T7:T110,
FILTER({Roster!A3:A, Roster!G3:BZ}, Roster!G2:BZ2=U6), 2, 0)))

Eliminate 0's in MMULT

Consider the following formula:
=ARRAYFORMULA(MMULT(N('E0:Sample'!$D$2:$AY),TRANSPOSE(SIGN(COLUMN(('E0:Sample'!$D$2:$AY))))))
The formula produces an array, in which blank cells are interpreted as 0. How do I get rid of all 0 in the produced range? I've tried to FILTER() it with
=ARRAYFORMULA(FILTER(MMULT(N('E0:Sample'!$D$2:$AY),TRANSPOSE(SIGN(COLUMN(('E0:Sample'!$D$2:$AY))))),'E0:Sample'!$D$2:$AY<>0))
but that produces FILTER range must be a single row or a single column.
Any ideas? Thank you!
Try the following pattern
=IF(formula=0,,formula)
In your case the final formula is
=ARRAYFORMULA(IF(
MMULT(N('E0:Sample'!$D$2:$AY),TRANSPOSE(SIGN(COLUMN(('E0:Sample'!$D$2:$AY)))))=0,,
MMULT(N('E0:Sample'!$D$2:$AY),TRANSPOSE(SIGN(COLUMN(('E0:Sample'!$D$2:$AY)))))
))

Google Spreadsheet, IF value is greater than 2 take the value next to it, over a range. Then sum

So right now my formula is
=SUM(IF(F15>=2, G15, 0), IF(F16>=2, G16, 0), IF(F17>=2, G17, 0), IF(F18>=2, G18, 0))
But I was wondering if there's an easier way to do this for a range as this should go to F29|G29
You can use SUMPRODUCT, making the first range a conditional one that will result to true/false (0/1), which will multiply by it's column below, if it's false will return 0, if it's true, will return (1*column G), as so:
=SUMPRODUCT(F15:F29>=2;G15:G29)
In Google Sheets, what you are looking for is the SUMIF function
To replicate what you are trying to do in the range provided in your question, you would need to use the following formula:
=SUMIF(F15:F29,">=2",G15:G29)
To use SUMPRODUCT in Google Sheets as per Kriggs answer, the parameters must be separated by a comma (,) not semi-colon(;) as follows:
=SUMPRODUCT(F15:F29>=2,G15:G29)

Resources