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
303 views
in Technique[技术] by (71.8m points)

google sheets - Why isn't the array formula applying to the entire column?

I have a formula in cells F1 and G1 of this sheet. I want to keep the text that is in cells F/G8 and F9&G9 however it's giving me an error. Note that the formula is in an array so that it can apply retroactively to all of the cells in the column.

Here is the code used in Cell F1:

=ARRAYFORMULA(IFNA(VLOOKUP(B2:B, QUERY('Raw Logs'!C2:F, "select C,sum(F) group by C label sum(F)''"), 4, 0)))

Here is the code used in Cell G1:

=ARRAYFORMULA(IFNA(VLOOKUP(B2:B, QUERY('Raw Logs'!C2:H, "select C,sum(H) group by C label sum(H)''"), 6, 0)))

Additionally, the data from the formula in Cell C1 is no longer populating (it was before) - the error says it can't because it's unable to overwrite C9 however there was text in C9 earlier and the data from the formula was still populating.

Here's the formula used in Cell C1:

=ArrayFormula(IFERROR(VLOOKUP(B:B,'Roster Registrations'!F1:G,2,FALSE)))

Any tips on how I can resolve this?

question from:https://stackoverflow.com/questions/65929900/why-isnt-the-array-formula-applying-to-the-entire-column

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

1 Answer

0 votes
by (71.8m points)

array formula needs a space to roll out - that's why. if you want to run it from that 1st row delete cells F8:F9 and use:

={"";"";"";"";"";"";"";"Total for February"; 
 "Activity"&CHAR(10)&"Hours"; ""; 
 ARRAYFORMULA(IFNA(VLOOKUP(B11:B&"", TEXT(QUERY('Raw Logs'!C2:F*1, 
 "select Col1,sum(Col4) 
  where Col1 is not null 
  group by Col1 
  label sum(Col4)''"), {"@", "[h]:mm:ss"}), 2, 0)))}

enter image description here


for G1 fx delete G9 and use this in G1:

={"";"";"";"";"";"";"";""; 
 "Number of"&CHAR(10)&"Tests"; ""; 
 ARRAYFORMULA(IFNA(VLOOKUP(B11:B, QUERY('Raw Logs'!C2:H*1, 
 "select Col1,sum(Col6) 
  where Col1 is not null 
    and Col1 <> 0
  group by Col1 
  label sum(Col6)''"), 2, 0)))}

enter image description here


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

...