Array Literal Was Missing Values in Google Sheets
Fix Google Sheets curly-brace array errors by matching list heights. Uneven pieces can return ARRAY_ROW mismatched size or ARRAY_LITERAL missing values.
本文目錄
A community library coordinator wants this week’s volunteer names beside next week’s names, starting in G1. This week has five names and next week has three. Combining the two lists in a curly-brace array fails unless the pieces have the same shape.
The working formula, which includes two empty cells under Next Week for the shorter list, is:
={"This Week","Next Week";A2:A6,C2:C6}
It returns a six-row comparison: a header row, Dana Ruiz beside Dana Ruiz, Otis Kline beside Vera Holm, Vera Holm beside Niko Abe, Quinn Patel beside a blank, and Niko Abe beside a blank. Those blanks are empty cells inside C2:C6, not missing positions in the array.
Enter the two lists first, before any formula refers to them.
Build the two volunteer lists
This week’s library desk schedule goes in A1:B6.
| Name | Slot |
|---|---|
| Dana Ruiz | Morning |
| Otis Kline | Afternoon |
| Vera Holm | Morning |
| Quinn Patel | Evening |
| Niko Abe | Afternoon |
Next week’s schedule goes in C1:D4.
| Name | Slot |
|---|---|
| Dana Ruiz | Afternoon |
| Vera Holm | Morning |
| Niko Abe | Evening |
Names are in A2:A6 與 C2:C4. C5 與 C6 stay genuinely empty; ISBLANK is TRUE for both.
One list is shorter than the other
This first attempt places the two name ranges side by side:
={A2:A6,C2:C4}
ROWS(A2:A6) returns 5. ROWS(C2:C4) returns 3. The formula returned #REF!, with the message “Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 5. Actual: 3.”
The comma places the two arrays side by side, so every row needs a position from both pieces. The second array stops after three rows, and Sheets cannot complete the fourth and fifth.
Extend the shorter reference to the same height:
={A2:A6,C2:C6}
This returns five rows and two columns. The first row is Dana Ruiz beside Dana Ruiz, and the fifth is Niko Abe beside a blank cell. Adding the headers around those equal-height ranges produces the working G1 formula above.
C2:C6 still has five positions even though only three cells contain names. ROWS(C2:C6) returns 5; COUNTA(C2:C6) returns 3. Use ROWS when you are checking whether two arrays fit together. COUNTA only tells you how many cells have values.
If you want visible placeholders, type Unassigned into C5 與 C6. The same corrected formula then shows Unassigned beside Quinn Patel and Niko Abe. Only do that when those placeholders belong in the schedule.
A missing row separator leaves a row incomplete
In a US-locale Google Sheet, a comma separates columns and a semicolon separates rows. This formula returns a 2×2 block, with 1 and 2 in the first row and 3 and 4 in the second:
={1,2;3,4}
This shorter version does not:
={1,2;3}
The first row has two values and the second has one. It returned #VALUE!, with the message “In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.” Complete the second row so the value in the bottom-right cell is 4.
Forgetting the semicolon is a different mistake. {1,2,3,4} is valid, but it is one row with four columns, not two rows with two columns. Putting the semicolon back between 2 and 3 places 3 at the start of the second row.
Not every separator mistake produces an ARRAY_LITERAL error. Some produce a valid array with the wrong shape; others are a parse error. Locale behavior that can turn {1,2;3,4} into decimals in a German-locale sheet is in formula parse error.
The header-plus-lists formula can also raise this same #VALUE! message. ={"This Week","Next Week";A2:A6,C2:C4} returned “In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.” The header is two columns wide, but the name ranges still have different heights. Extending the second range to C2:C6 repairs it, as in the opening formula.
Empty cells still occupy a position
An empty cell inside a referenced range still occupies a position. That is why C2:C6 works and C2:C4 does not. A position the construction never supplies, such as the missing 4 in {1,2;3}, is a different failure.
If you want to keep the next-week list untouched and stack padding underneath this week’s names, enter Unassigned in E2 與 E3, then use:
={A2:A6;E2:E3}
This returns a seven-row, single-column list: the five current-week names followed by two Unassigned entries. That is vertical stacking, which needs matching column counts, not matching row counts. For the coordinator’s side-by-side layout, extending C2:C4 to C2:C6 is simpler.
FILTER results can have different heights
The same construction problem appears when the pieces are calculated arrays. These two FILTER formulas are each valid:
=FILTER(A2:A6,B2:B6="Morning")
This returns Dana Ruiz and Vera Holm.
=FILTER(C2:C4,D2:D4="Morning")
This returns Vera Holm. Placing those results side by side fails:
={FILTER(A2:A6,B2:B6="Morning"),FILTER(C2:C4,D2:D4="Morning")}
The first FILTER has two rows and the second has one. The formula returned #REF!, with the message “Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 2. Actual: 1.” ROWS(FILTER(A2:A6,B2:B6="Morning")) returns 2, and ROWS(FILTER(C2:C4,D2:D4="Morning")) returns 1.
On a small schedule you can pad the shorter result in helper cells, then combine equal-height ranges. Enter the first FILTER in J1 (Dana Ruiz spills into J2), enter the second in K1 (Vera Holm), and leave K2 genuinely empty. Then:
={J1:J2,K1:K2}
This returns Dana Ruiz beside Vera Holm, and Vera Holm beside a blank. If the number of matches changes often, a fixed two-row helper range may be too small.
A FILTER that finds no rows is a different #N/A: “No matches are found in FILTER evaluation.” A FILTER whose data range and condition range have different sizes is also a different #N/A. See FILTER mismatched range sizes for that message.
Check both dimensions before joining array pieces
Build the pieces, measure them, and only then wrap them in {}. For the original comparison, ROWS(A2:A6) 與 ROWS(C2:C6) both return 5, and COLUMNS of each is 1, so they can sit side by side.
When stacking vertically, the widths must match. This formula returns eight rows and two columns, with the five current-week records above the three next-week records:
={A2:B6;C2:D4}
COLUMNS(A2:B6) 與 COLUMNS(C2:D4) both return 2, so the stack works even though the row counts differ. Stacking A2:B6 over the one-column range C2:C4 returned #VALUE! and “In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.”
The practical rule is: for a comma (side by side), match the row counts; for a semicolon (one under the other), match the column counts. For the library schedule, I’d use the equal-height ranges in the G1 formula rather than a more complicated padding expression.
Don’t hide the missing values with IFERROR
Wrapping the broken side-by-side array in IFERROR does not fix the heights:
=IFERROR({A2:A6,C2:C4},"")
It displayed a blank. IFERROR around {1,2;3} also displayed a blank. Either way, the coordinator can mistake a layout error for an empty roster. Use the corrected array instead:
={A2:A6,C2:C6}
This shows all five current-week names alongside the three next-week names, with two empty positions in the second column still visible.
A blocked output is a different problem
If the array has compatible dimensions but its destination cells already contain data, Sheets reports that the array result was not expanded, not a missing-values or ARRAY_ROW size error. See array result was not expanded. Fix the dimensions inside the formula first, then check that the destination has room to spill.