Google Sheets: Fill series with cell references - google-sheets

I want to fill cells B2:D148 with =VLOOKUP(Sheet8!B2, Descriptions!A3:B, 2, FALSE), replacing B2 in the formula with the current cell. If I use that formula for B2, then series-fill to C2, I get =VLOOKUP(Sheet8!C2, Descriptions!B3:C, 2, FALSE). C2 updates successfully, but it also increments the lookup range, which should be static.
If I manually fix C2 and D2, then series-fill down to Row 3, it's closer, but the A3 reference still becomes A4, which doesn't work.
Is there any way to series-fill one reference in a formula but not the other?
Alternately, is there any way to reference "this" cell, something like =VLOOKUP(Sheet8!$THIS_CELL, Descriptions!A3:B, 2, FALSE)? If so, I could just copy that formula to the entire range.
Thanks!

Why don't you wrap your VLOOKUP in an ARRAYFORMULA() ?
In B2, try:
=ARRAYFORMULA(VLOOKUP(Sheet8!B2:D148, Descriptions!A3:B, 2, FALSE)
NOTE: you will have to make sure there are no othere values or formulas present in the range D2:D148

Related

How to use autofill in Google Sheet formula?

I have formula to auto fill data like column A. It is no need to hand dragging or auto filling by suggestion.
Here column A is perfectly done. Cell A1 formula as below:
={ "VendorNo"; unique(General!A2:A) }
Cell B1 formula is correct as below:
LOOKUP(VendorStatus!A2,sort(General!A2:A),sort(General!C2:C,General!A2:A,TRUE))
Once cell A1 is done, all A column is real auto filled. All I want is to do is the same effect like cell A1. How can I rewrite B1 formula to auto filled the rest B column value?
P.S.: I am sorry I couldn't post image above directly because I don't have enough reputation.
Try in B1 (assuming your formula gives you the right answer)
={"EventStartDate";arrayformula(if(A2:A="",,LOOKUP(A2:A,sort(General!A:A),sort(General!C:C,General!A:A,TRUE))))}
try in row 1:
={"event start date"; INDEX(IFNA(VLOOKUP(A2:A, General!A2:C, 3, 0)))}
or:
={"event start date"; INDEX(IFNA(VLOOKUP(A2:A,
SORT(General!A2:C, ROW(General!A2:C), 0), 3, 0)))}

Google Sheets: how to sum a dynamic range across columns using a variable to determine range length

I'm trying to write a formula in Google Sheets that will enable me to sum a range of values across columns, where I can manipulate the number of cells to be summed across the column with a variable. For example:
if my variable is 5, then I want to sum(D3:H3);
and if my variable is 9, then I want to sum(D3:L3)
Furthermore, I want a formula that I can drag across columns so that the range it's summing moves relative to the cell the formula is in. In the example above with the variable=5:
the formula in cell A3 would be sum(D3:H3);
and the formula in cell B3 would be sum(E3:I3)
etc.
I created a sample spreadsheet here for more context.
Thanks for reading!
I've added a sheet ("Erik Help"). See formula in B5:P5.
Here is the B5 formula (which was then dragged across to P5):
=ArrayFormula(SUM(FILTER($B$1:$1,COLUMN($B$1:$1)>(COLUMN()-$B$4),COLUMN($B$1:$1)<=COLUMN())))
There may be an array approach. But since you have such limited data, this is just as effective with less time investment required to develop the solution.
In plain English, the formula reads "Sum the numbers from B1:1 where the column is greater than X rows back and no greater than the current column" (where X is the value set in B4).
paste in column B and drag to the right:
=IF(COLUMN()-1<$B1, "-", SUM(INDIRECT(
ADDRESS(3, COLUMN()-($B1-1))&":"&
ADDRESS(3, COLUMN()))))

Make AVERAGE only for numerical values

I have some problem to build a dynamic AVERAGE in Google Sheets.
What I have here is this configuration.
I have a Cell A1, B2 and C3 that have another formula (like IF) that can return 2 different values: Numerical or N/A.
Then I have Cell D4 which keep the AVERAGE of cell A1, B2, C3.
The problem is that even if one of the above cells (A1, B2, C3) has N/A even the AVERAGE results returns N/A.
Are there any possibilities to make the AVERAGE working by ignoring N/A or any kind of texts and working only with Numbers?
This is the formula I have at the moment: =AVERAGE(A1, B2, C3).
you will need to wrap it into IFERROR like:
=AVERAGE(IFERROR(A1), IFERROR(B2), IFERROR(C3))

Google Spreadsheet: E2-F2 even if i move the rows

I'm having an issue with google spreadsheets. I want to... have Cell C2 always contain the difference between cell E2 and F2 even if I move the row (i don't want the formula to adapt to that change of rows, the formula should still be E2-F2); so let's say E2 contains 5 and F2 contains 3, C2 would display 2. So let's say I switch row E and row F. Right now the result displayed would still be 2, and the formula in cell C2 would've changed to F2-E2. What I want is the formula not to change, and the result displayed would be -3.
=INDIRECT(E2)-INDIRECT(F2) didn't work for me - it gave me a reference error.
The INDIRECT function expects a string parameter. So you would need to write
=INDIRECT("E2")-INDIRECT("F2")
But the better way to solve your problem would be to use absolute references
=$E$2-$F$2

Sparkline in every row with only one arrayformula google sheets

I would like to plot sparklines (barchart with the value to show in B-row and the max-value in die C-row: see linked file) in every cell from A2 to A5 using ony one arrayformula (=ARRAYFORMULA( ...) in A2 which can plot spakrlines in every cell from A2 to A5.
Link to file: sparkline arrayformula
Thx for any help,
Gerd
SPARKLINE does not work with arrayformula. I think the best you can do is put this in A2 and drag it down past A5. It will pick up new data.
=iferror(SPARKLINE(B2,{"charttype","bar";"max",C2}),"")
Hmm
Make a blank column A:A.
=ARRAYFORMULA(IF(ISBLANK($A$1:$A),"", SPARKLINE({0,1},{"color","#ddd"})))

Resources